diff --git a/Zend/tests/access_modifiers/access_modifiers_008.phpt b/Zend/tests/access_modifiers/access_modifiers_008.phpt
index 1cce8767d850..57c555bb6345 100644
--- a/Zend/tests/access_modifiers/access_modifiers_008.phpt
+++ b/Zend/tests/access_modifiers/access_modifiers_008.phpt
@@ -33,18 +33,18 @@ class B2 extends A {
try {
echo A::mp() . "\n";
} catch (\Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo B1::ma() . "\n"; // protected method defined also in A
try {
echo B1::mp() . "\n"; // protected method defined also in A but as private
} catch (\Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo B1::mb() . "\n";
} catch (\Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -54,7 +54,7 @@ B2::test();
?>
--EXPECT--
A::ma()
-Call to private method A::mp() from scope B2
+Error: Call to private method A::mp() from scope B2
B1::ma()
-Call to protected method B1::mp() from scope B2
-Call to protected method B1::mb() from scope B2
+Error: Call to protected method B1::mp() from scope B2
+Error: Call to protected method B1::mb() from scope B2
diff --git a/Zend/tests/add_002.phpt b/Zend/tests/add_002.phpt
index 9077ece08587..7611602d1a34 100644
--- a/Zend/tests/add_002.phpt
+++ b/Zend/tests/add_002.phpt
@@ -11,7 +11,7 @@ $o->prop = "value";
try {
var_dump($a + $o);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $a + $o;
@@ -20,7 +20,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array + stdClass
+TypeError: Unsupported operand types: array + stdClass
Fatal error: Uncaught TypeError: Unsupported operand types: array + stdClass in %s:%d
Stack trace:
diff --git a/Zend/tests/add_003.phpt b/Zend/tests/add_003.phpt
index 6d27863e893f..cf4684279fb3 100644
--- a/Zend/tests/add_003.phpt
+++ b/Zend/tests/add_003.phpt
@@ -11,7 +11,7 @@ $o->prop = "value";
try {
var_dump($o + $a);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $o + $a;
@@ -20,7 +20,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: stdClass + array
+TypeError: Unsupported operand types: stdClass + array
Fatal error: Uncaught TypeError: Unsupported operand types: stdClass + array in %s:%d
Stack trace:
diff --git a/Zend/tests/add_004.phpt b/Zend/tests/add_004.phpt
index 2f16f10eaf50..08e8a70c900f 100644
--- a/Zend/tests/add_004.phpt
+++ b/Zend/tests/add_004.phpt
@@ -8,7 +8,7 @@ $a = array(1,2,3);
try {
var_dump($a + 5);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $a + 5;
@@ -17,7 +17,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array + int
+TypeError: Unsupported operand types: array + int
Fatal error: Uncaught TypeError: Unsupported operand types: array + int in %s:%d
Stack trace:
diff --git a/Zend/tests/add_006.phpt b/Zend/tests/add_006.phpt
index 09945f3fce6c..00b0ad68a6e7 100644
--- a/Zend/tests/add_006.phpt
+++ b/Zend/tests/add_006.phpt
@@ -15,7 +15,7 @@ try {
$c = $i + $s1;
var_dump($c);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$c = $i + $s2;
var_dump($c);
@@ -30,7 +30,7 @@ try {
$c = $s1 + $i;
var_dump($c);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$c = $s2 + $i;
@@ -45,13 +45,13 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Unsupported operand types: int + string
+TypeError: Unsupported operand types: int + string
Warning: A non-numeric value encountered in %s on line %d
int(951858)
int(48550510)
float(75661.68)
-Unsupported operand types: string + int
+TypeError: Unsupported operand types: string + int
Warning: A non-numeric value encountered in %s on line %d
int(951858)
diff --git a/Zend/tests/add_007.phpt b/Zend/tests/add_007.phpt
index a2beddfaed41..7119d253b98c 100644
--- a/Zend/tests/add_007.phpt
+++ b/Zend/tests/add_007.phpt
@@ -10,7 +10,7 @@ $s1 = "some string";
try {
var_dump($a + $s1);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $a + $s1;
@@ -19,7 +19,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array + string
+TypeError: Unsupported operand types: array + string
Fatal error: Uncaught TypeError: Unsupported operand types: array + string in %s:%d
Stack trace:
diff --git a/Zend/tests/arg_unpack/invalid_type.phpt b/Zend/tests/arg_unpack/invalid_type.phpt
index a0e649371528..99b54f7fe842 100644
--- a/Zend/tests/arg_unpack/invalid_type.phpt
+++ b/Zend/tests/arg_unpack/invalid_type.phpt
@@ -10,28 +10,28 @@ function test(...$args) {
try {
test(...null);
} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...42);
} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...new stdClass);
} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(1, 2, 3, ..."foo", ...[4, 5]);
} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/arg_unpack/non_integer_keys.phpt b/Zend/tests/arg_unpack/non_integer_keys.phpt
index 88e1747df9c3..3ab978440add 100644
--- a/Zend/tests/arg_unpack/non_integer_keys.phpt
+++ b/Zend/tests/arg_unpack/non_integer_keys.phpt
@@ -13,9 +13,9 @@ function gen() {
try {
foo(...gen());
} catch (Error $ex) {
- echo "Exception: " . $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Keys must be of type int|string during argument unpacking
+Error: Keys must be of type int|string during argument unpacking
diff --git a/Zend/tests/arg_unpack/string_keys.phpt b/Zend/tests/arg_unpack/string_keys.phpt
index b0bf366fb38d..7a55c6e8ab7e 100644
--- a/Zend/tests/arg_unpack/string_keys.phpt
+++ b/Zend/tests/arg_unpack/string_keys.phpt
@@ -10,9 +10,9 @@ set_error_handler(function($errno, $errstr) {
try {
var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
} catch (Error $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-string(68) "Cannot use positional argument after named argument during unpacking"
+Error: Cannot use positional argument after named argument during unpacking
diff --git a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
index c78e491e2015..2712b9694094 100644
--- a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
+++ b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
@@ -21,13 +21,13 @@ function gen() {
try {
test(1, 2, ...new Foo, ...[3, 4]);
-} catch (Exception $e) { var_dump($e->getMessage()); }
+} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try {
test(1, 2, ...gen(), ...[3, 4]);
-} catch (Exception $e) { var_dump($e->getMessage()); }
+} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
?>
--EXPECT--
-string(11) "getIterator"
-string(3) "gen"
+Exception: getIterator
+Exception: gen
diff --git a/Zend/tests/array_literal_next_element_error.phpt b/Zend/tests/array_literal_next_element_error.phpt
index 23dec5e22cae..2bf63d162dab 100644
--- a/Zend/tests/array_literal_next_element_error.phpt
+++ b/Zend/tests/array_literal_next_element_error.phpt
@@ -8,17 +8,17 @@ try {
$array = [$i => 42, new stdClass];
var_dump($array);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function test($x = [PHP_INT_MAX => 42, "foo"]) {}
try {
test();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/array_merge_recursive_next_key_overflow.phpt b/Zend/tests/array_merge_recursive_next_key_overflow.phpt
index f7d287295783..492d06973b49 100644
--- a/Zend/tests/array_merge_recursive_next_key_overflow.phpt
+++ b/Zend/tests/array_merge_recursive_next_key_overflow.phpt
@@ -8,7 +8,7 @@ try {
['' => [null]],
);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -17,9 +17,9 @@ try {
['foo' => str_repeat('a', 2)],
);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/array_unpack/already_occupied.phpt b/Zend/tests/array_unpack/already_occupied.phpt
index b2febe002156..e529324289f2 100644
--- a/Zend/tests/array_unpack/already_occupied.phpt
+++ b/Zend/tests/array_unpack/already_occupied.phpt
@@ -9,13 +9,13 @@ $arr = [1, 2, 3];
try {
var_dump([PHP_INT_MAX-1 => 0, ...$arr]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump([PHP_INT_MAX-1 => 0, ...[1, 2, 3]]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
const ARR = [1, 2, 3];
@@ -23,11 +23,11 @@ function test($x = [PHP_INT_MAX-1 => 0, ...ARR]) {}
try {
test();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/array_unpack/classes.phpt b/Zend/tests/array_unpack/classes.phpt
index fa4b0f8e536f..d7029cfb2dc9 100644
--- a/Zend/tests/array_unpack/classes.phpt
+++ b/Zend/tests/array_unpack/classes.phpt
@@ -20,7 +20,7 @@ var_dump(C::$bar);
try {
var_dump(D::A);
} catch (Error $ex) {
- echo "Exception: " . $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
@@ -44,4 +44,4 @@ array(3) {
[2]=>
int(3)
}
-Exception: Cannot declare self-referencing constant self::B
+Error: Cannot declare self-referencing constant self::B
diff --git a/Zend/tests/array_unpack/non_integer_keys.phpt b/Zend/tests/array_unpack/non_integer_keys.phpt
index ab7a20ac86b9..31002eb61096 100644
--- a/Zend/tests/array_unpack/non_integer_keys.phpt
+++ b/Zend/tests/array_unpack/non_integer_keys.phpt
@@ -10,9 +10,9 @@ function gen() {
try {
[...gen()];
} catch (Error $ex) {
- echo "Exception: " . $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
diff --git a/Zend/tests/arrow_functions/006.phpt b/Zend/tests/arrow_functions/006.phpt
index 6f61b3c817d9..a43d6c73536f 100644
--- a/Zend/tests/arrow_functions/006.phpt
+++ b/Zend/tests/arrow_functions/006.phpt
@@ -17,7 +17,7 @@ var_dump($int_fn($var));
try {
$int_fn("foo");
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$varargs = fn(?int... $args): array => $args;
@@ -25,14 +25,14 @@ var_dump($varargs(20, null, 30));
try {
$varargs(40, "foo");
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
int(2)
int(10)
-{closure:%s:%d}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
array(3) {
[0]=>
int(20)
@@ -41,4 +41,4 @@ array(3) {
[2]=>
int(30)
}
-{closure:%s:%d}(): Argument #2 must be of type ?int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #2 must be of type ?int, string given, called in %s on line %d
diff --git a/Zend/tests/arrow_functions/007.phpt b/Zend/tests/arrow_functions/007.phpt
index 66b03b84c2e9..d915195e464f 100644
--- a/Zend/tests/arrow_functions/007.phpt
+++ b/Zend/tests/arrow_functions/007.phpt
@@ -8,16 +8,16 @@ zend.assertions=1
try {
assert((fn() => false)());
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert((fn&(int... $args): ?bool => $args[0])(false));
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(): assert((fn() => false)()) failed
-assert(): assert((fn&(int ...$args): ?bool => $args[0])(false)) failed
+AssertionError: assert((fn() => false)())
+AssertionError: assert((fn&(int ...$args): ?bool => $args[0])(false))
diff --git a/Zend/tests/arrow_functions/gh7900.phpt b/Zend/tests/arrow_functions/gh7900.phpt
index d6465c312399..c33b86701831 100644
--- a/Zend/tests/arrow_functions/gh7900.phpt
+++ b/Zend/tests/arrow_functions/gh7900.phpt
@@ -11,16 +11,16 @@ $x = fn(): never => throw new \Exception('Here');
try {
var_dump($x());
} catch (\Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert((fn(): never => 42) && false);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Here
-assert((fn(): never => 42) && false)
+Exception: Here
+AssertionError: assert((fn(): never => 42) && false)
diff --git a/Zend/tests/assert/bug70528.phpt b/Zend/tests/assert/bug70528.phpt
index 717c096fdaa3..1b90541b2463 100644
--- a/Zend/tests/assert/bug70528.phpt
+++ b/Zend/tests/assert/bug70528.phpt
@@ -12,20 +12,20 @@ $bar = "Bar";
try {
assert(new \stdClass instanceof $bar);
} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(new \stdClass instanceof Bar);
} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(new \stdClass instanceof \Foo\Bar);
} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(): assert(new \stdClass() instanceof $bar) failed
-assert(): assert(new \stdClass() instanceof Bar) failed
-assert(): assert(new \stdClass() instanceof \Foo\Bar) failed
+AssertionError: assert(new \stdClass() instanceof $bar)
+AssertionError: assert(new \stdClass() instanceof Bar)
+AssertionError: assert(new \stdClass() instanceof \Foo\Bar)
diff --git a/Zend/tests/assert/bug71922.phpt b/Zend/tests/assert/bug71922.phpt
index 986254cab732..479ef6de7d70 100644
--- a/Zend/tests/assert/bug71922.phpt
+++ b/Zend/tests/assert/bug71922.phpt
@@ -11,11 +11,11 @@ try {
} && new class(42) extends stdclass {
});
} catch (AssertionError $e) {
- echo "Assertion failure: ", $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Assertion failure: assert(0 && new class {
+AssertionError: assert(0 && new class {
} && new class(42) extends stdclass {
})
diff --git a/Zend/tests/assert/expect_003.phpt b/Zend/tests/assert/expect_003.phpt
index 350fca6e57b0..57f20620ab58 100644
--- a/Zend/tests/assert/expect_003.phpt
+++ b/Zend/tests/assert/expect_003.phpt
@@ -8,8 +8,8 @@ assert.exception=1
try {
assert(false);
} catch (AssertionError $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-string(13) "assert(false)"
+AssertionError: assert(false)
diff --git a/Zend/tests/assert/expect_004.phpt b/Zend/tests/assert/expect_004.phpt
index 111e37295fe9..20b15e8e10e5 100644
--- a/Zend/tests/assert/expect_004.phpt
+++ b/Zend/tests/assert/expect_004.phpt
@@ -8,8 +8,8 @@ assert.exception=1
try {
assert(false, "I require this to succeed");
} catch (AssertionError $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-string(25) "I require this to succeed"
+AssertionError: I require this to succeed
diff --git a/Zend/tests/assert/expect_005.phpt b/Zend/tests/assert/expect_005.phpt
index f2c91f25666e..60ff388e0521 100644
--- a/Zend/tests/assert/expect_005.phpt
+++ b/Zend/tests/assert/expect_005.phpt
@@ -9,7 +9,7 @@ try {
/* by passing we test there are no leaks upon success */
assert(true, "I require this to succeed");
} catch (AssertionError $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
var_dump(true);
?>
diff --git a/Zend/tests/assert/expect_015.phpt b/Zend/tests/assert/expect_015.phpt
index 3bb08504f581..515f4d7238a1 100644
--- a/Zend/tests/assert/expect_015.phpt
+++ b/Zend/tests/assert/expect_015.phpt
@@ -20,7 +20,7 @@ assert(0 && ($a = function () {
yield from $x;
}));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
@@ -69,7 +69,7 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
}
}));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
@@ -105,7 +105,7 @@ L0:
}
}));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
@@ -121,7 +121,7 @@ assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
}
}));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
@@ -138,7 +138,7 @@ assert(0 && ($a = function &(array &...$a) {
}
}));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
@@ -166,12 +166,12 @@ assert(0 && ($a = function (): ?static {
if ($a); else;
}));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(0 && ($a = function () {
+AssertionError: assert(0 && ($a = function () {
global $a;
global $$b;
static $c;
@@ -187,7 +187,7 @@ assert(0 && ($a = function () {
yield 1 => 2;
yield from $x;
}))
-assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
+AssertionError: assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
abstract class A extends B implements C, D {
public const X = 12;
public const Y = self::X, Z = 'aaa';
@@ -231,7 +231,7 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
}
}))
-assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X {
+AssertionError: assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X {
final class A {
protected final function f2() {
if (!$x) {
@@ -270,7 +270,7 @@ assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d):
}
}))
-assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
+AssertionError: assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
class A {
use T1, T2 {
T1::foo insteadof foo;
@@ -282,7 +282,7 @@ assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
}
}))
-assert(0 && ($a = function &(array &...$a) {
+AssertionError: assert(0 && ($a = function &(array &...$a) {
declare(A = 1, B = 2);
try {
$i++;
@@ -294,7 +294,7 @@ assert(0 && ($a = function &(array &...$a) {
echo 3;
}
}))
-assert(0 && ($a = function (): ?static {
+AssertionError: assert(0 && ($a = function (): ?static {
declare(C = 1) {
echo 1;
}
diff --git a/Zend/tests/assert/expect_016.phpt b/Zend/tests/assert/expect_016.phpt
index 32e8fea91715..80f477b5e20d 100644
--- a/Zend/tests/assert/expect_016.phpt
+++ b/Zend/tests/assert/expect_016.phpt
@@ -11,7 +11,7 @@ ini_set("zend.assertions", 1);
try {
var_dump(assert(false));
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(assert(true));
ini_set("zend.assertions", -1);
@@ -19,7 +19,7 @@ ini_set("zend.assertions", -1);
--EXPECTF--
bool(true)
bool(true)
-assert(): assert(false) failed
+AssertionError: assert(false)
bool(true)
Warning: zend.assertions may be completely enabled or disabled only in php.ini in %s on line %d
diff --git a/Zend/tests/assert/expect_018.phpt b/Zend/tests/assert/expect_018.phpt
index abe74ce25225..9fd6610abc42 100644
--- a/Zend/tests/assert/expect_018.phpt
+++ b/Zend/tests/assert/expect_018.phpt
@@ -15,13 +15,13 @@ ini_set("zend.assertions", 1);
try {
var_dump(\assert(false));
} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(\assert(true));
try {
var_dump(assert(false));
} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(assert(true));
?>
@@ -30,7 +30,7 @@ bool(true)
bool(true)
bool(true)
bool(true)
-assert(): assert(false) failed
+AssertionError: assert(false)
bool(true)
-assert(): assert(false) failed
+AssertionError: assert(false)
bool(true)
diff --git a/Zend/tests/assign_dim_obj_null_return.phpt b/Zend/tests/assign_dim_obj_null_return.phpt
index e2b7f20a0c07..eefe2b206ecf 100644
--- a/Zend/tests/assign_dim_obj_null_return.phpt
+++ b/Zend/tests/assign_dim_obj_null_return.phpt
@@ -10,60 +10,60 @@ function test() {
try {
var_dump($array[] = 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[[]] = 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[new stdClass] = 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true[123] = 456);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[] += 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[[]] += 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[new stdClass] += 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true[123] += 456);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true->foo = 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true->foo += 123);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -71,13 +71,13 @@ test();
?>
--EXPECT--
-Cannot add element to the array as the next element is already occupied
-Cannot access offset of type array on array
-Cannot access offset of type stdClass on array
-Cannot use a scalar value as an array
-Cannot add element to the array as the next element is already occupied
-Cannot access offset of type array on array
-Cannot access offset of type stdClass on array
-Cannot use a scalar value as an array
-Attempt to assign property "foo" on true
-Attempt to assign property "foo" on true
+Error: Cannot add element to the array as the next element is already occupied
+TypeError: Cannot access offset of type array on array
+TypeError: Cannot access offset of type stdClass on array
+Error: Cannot use a scalar value as an array
+Error: Cannot add element to the array as the next element is already occupied
+TypeError: Cannot access offset of type array on array
+TypeError: Cannot access offset of type stdClass on array
+Error: Cannot use a scalar value as an array
+Error: Attempt to assign property "foo" on true
+Error: Attempt to assign property "foo" on true
diff --git a/Zend/tests/assign_op_type_error.phpt b/Zend/tests/assign_op_type_error.phpt
index 5f175613e20b..c132f74de2f9 100644
--- a/Zend/tests/assign_op_type_error.phpt
+++ b/Zend/tests/assign_op_type_error.phpt
@@ -7,51 +7,51 @@ $x = [];
try {
$x += "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x -= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x *= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x /= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x **= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x %= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x <<= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x >>= "1";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: array + string
-Unsupported operand types: array - string
-Unsupported operand types: array * string
-Unsupported operand types: array / string
-Unsupported operand types: array ** string
-Unsupported operand types: array % string
-Unsupported operand types: array << string
-Unsupported operand types: array >> string
+TypeError: Unsupported operand types: array + string
+TypeError: Unsupported operand types: array - string
+TypeError: Unsupported operand types: array * string
+TypeError: Unsupported operand types: array / string
+TypeError: Unsupported operand types: array ** string
+TypeError: Unsupported operand types: array % string
+TypeError: Unsupported operand types: array << string
+TypeError: Unsupported operand types: array >> string
diff --git a/Zend/tests/assign_property_null_object.phpt b/Zend/tests/assign_property_null_object.phpt
index fff2c99f6201..9119e96cca34 100644
--- a/Zend/tests/assign_property_null_object.phpt
+++ b/Zend/tests/assign_property_null_object.phpt
@@ -16,7 +16,7 @@ print "ok\n";
try {
$test->a()->a = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
print "ok\n";
@@ -24,5 +24,5 @@ print "ok\n";
--EXPECTF--
Warning: Attempt to read property "a" on null in %s on line %d
ok
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
ok
diff --git a/Zend/tests/assign_ref_error_var_handling.phpt b/Zend/tests/assign_ref_error_var_handling.phpt
index 2a66b68cc549..312b7e345158 100644
--- a/Zend/tests/assign_ref_error_var_handling.phpt
+++ b/Zend/tests/assign_ref_error_var_handling.phpt
@@ -12,19 +12,19 @@ $arr = [PHP_INT_MAX => "foo"];
try {
var_dump($arr[] =& $var);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(count($arr));
try {
var_dump($arr[] =& val());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(count($arr));
?>
--EXPECT--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
int(1)
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
int(1)
diff --git a/Zend/tests/assign_to_obj_002.phpt b/Zend/tests/assign_to_obj_002.phpt
index a911c06f36d5..bb4810d37f62 100644
--- a/Zend/tests/assign_to_obj_002.phpt
+++ b/Zend/tests/assign_to_obj_002.phpt
@@ -5,8 +5,8 @@ Assign to $this leaks when $this not defined
try {
$this->a = new stdClass;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
?>
--EXPECT--
-Using $this when not in object context
+Error: Using $this when not in object context
diff --git a/Zend/tests/ast/ast_serialize_backtick_literal.phpt b/Zend/tests/ast/ast_serialize_backtick_literal.phpt
index 46aa0ebe8ae2..62727fcc2c26 100644
--- a/Zend/tests/ast/ast_serialize_backtick_literal.phpt
+++ b/Zend/tests/ast/ast_serialize_backtick_literal.phpt
@@ -8,9 +8,9 @@ zend.assertions=1
try {
assert(false && `echo -n ""`);
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(): assert(false && `echo -n ""`) failed
+AssertionError: assert(false && `echo -n ""`)
diff --git a/Zend/tests/ast/ast_serialize_floats.phpt b/Zend/tests/ast/ast_serialize_floats.phpt
index 164b8b03338c..ec73c38205d5 100644
--- a/Zend/tests/ast/ast_serialize_floats.phpt
+++ b/Zend/tests/ast/ast_serialize_floats.phpt
@@ -7,20 +7,20 @@ zend.assertions=1
try {
assert(!is_float(0.0));
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(!is_float(1.1));
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(!is_float(1234.5678));
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(): assert(!is_float(0.0)) failed
-assert(): assert(!is_float(1.1)) failed
-assert(): assert(!is_float(1234.5678)) failed
+AssertionError: assert(!is_float(0.0))
+AssertionError: assert(!is_float(1.1))
+AssertionError: assert(!is_float(1234.5678))
diff --git a/Zend/tests/ast/gh21072.phpt b/Zend/tests/ast/gh21072.phpt
index 1ffd0518eaea..8b144acf0456 100644
--- a/Zend/tests/ast/gh21072.phpt
+++ b/Zend/tests/ast/gh21072.phpt
@@ -10,7 +10,7 @@ try {
}
new C;
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
diff --git a/Zend/tests/ast/zend-pow-assign.phpt b/Zend/tests/ast/zend-pow-assign.phpt
index fd8bf8346cec..1b45f5a386f6 100644
--- a/Zend/tests/ast/zend-pow-assign.phpt
+++ b/Zend/tests/ast/zend-pow-assign.phpt
@@ -8,8 +8,8 @@ zend.assertions=1
try {
assert(false && ($a **= 2));
} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(): assert(false && ($a **= 2)) failed
+AssertionError: assert(false && ($a **= 2))
diff --git a/Zend/tests/asymmetric_visibility/__set.phpt b/Zend/tests/asymmetric_visibility/__set.phpt
index 7476f5304e25..e9378baabaf4 100644
--- a/Zend/tests/asymmetric_visibility/__set.phpt
+++ b/Zend/tests/asymmetric_visibility/__set.phpt
@@ -23,14 +23,14 @@ $foo = new Foo();
try {
$foo->bar = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBar('baz');
try {
$foo->bar = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->unsetBar();
@@ -38,6 +38,6 @@ $foo->bar = 'baz';
?>
--EXPECT--
-Cannot modify private(set) property Foo::$bar from global scope
-Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
Foo::Foo::__set
diff --git a/Zend/tests/asymmetric_visibility/__unset.phpt b/Zend/tests/asymmetric_visibility/__unset.phpt
index 3d5977d79782..06ded24915d4 100644
--- a/Zend/tests/asymmetric_visibility/__unset.phpt
+++ b/Zend/tests/asymmetric_visibility/__unset.phpt
@@ -23,7 +23,7 @@ function test($foo) {
try {
unset($foo->bar);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -41,7 +41,7 @@ test($foo);
?>
--EXPECT--
-Cannot unset private(set) property Foo::$bar from global scope
+Error: Cannot unset private(set) property Foo::$bar from global scope
Foo::__unset
-Cannot unset private(set) property Foo::$bar from global scope
+Error: Cannot unset private(set) property Foo::$bar from global scope
Foo::__unset
diff --git a/Zend/tests/asymmetric_visibility/ast_printing.phpt b/Zend/tests/asymmetric_visibility/ast_printing.phpt
index 25803e67c09d..ab91e6dcf8d8 100644
--- a/Zend/tests/asymmetric_visibility/ast_printing.phpt
+++ b/Zend/tests/asymmetric_visibility/ast_printing.phpt
@@ -14,12 +14,12 @@ try {
}
} && false);
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(function () {
+AssertionError: assert(function () {
class Foo {
public private(set) string $bar;
public protected(set) string $baz;
diff --git a/Zend/tests/asymmetric_visibility/bug001.phpt b/Zend/tests/asymmetric_visibility/bug001.phpt
index c306434d610b..88d9839541ec 100644
--- a/Zend/tests/asymmetric_visibility/bug001.phpt
+++ b/Zend/tests/asymmetric_visibility/bug001.phpt
@@ -20,13 +20,13 @@ $c = new D();
try {
unset($c->a);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($c);
?>
--EXPECTF--
-Cannot unset private(set) property C::$a from scope D
+Error: Cannot unset private(set) property C::$a from scope D
object(D)#%d (0) {
["a"]=>
uninitialized(int)
diff --git a/Zend/tests/asymmetric_visibility/bug002.phpt b/Zend/tests/asymmetric_visibility/bug002.phpt
index 1f6dc2b85278..915796b7c1ab 100644
--- a/Zend/tests/asymmetric_visibility/bug002.phpt
+++ b/Zend/tests/asymmetric_visibility/bug002.phpt
@@ -20,13 +20,13 @@ $c = new D();
try {
$c->a = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($c);
?>
--EXPECTF--
-Cannot modify private(set) property C::$a from scope D
+Error: Cannot modify private(set) property C::$a from scope D
object(D)#%d (0) {
["a"]=>
uninitialized(int)
diff --git a/Zend/tests/asymmetric_visibility/bug003.phpt b/Zend/tests/asymmetric_visibility/bug003.phpt
index 9f541f87f7cd..979c4c167e4b 100644
--- a/Zend/tests/asymmetric_visibility/bug003.phpt
+++ b/Zend/tests/asymmetric_visibility/bug003.phpt
@@ -14,15 +14,15 @@ $c = new C();
try {
$c->a = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($c->a);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify private(set) property C::$a from global scope
-Cannot unset private(set) property C::$a from global scope
+Error: Cannot modify private(set) property C::$a from global scope
+Error: Cannot unset private(set) property C::$a from global scope
diff --git a/Zend/tests/asymmetric_visibility/cpp_private.phpt b/Zend/tests/asymmetric_visibility/cpp_private.phpt
index c308330d3ab0..b6ebfa294422 100644
--- a/Zend/tests/asymmetric_visibility/cpp_private.phpt
+++ b/Zend/tests/asymmetric_visibility/cpp_private.phpt
@@ -19,7 +19,7 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBar('baz');
@@ -28,5 +28,5 @@ var_dump($foo->bar);
?>
--EXPECT--
string(3) "bar"
-Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
string(3) "baz"
diff --git a/Zend/tests/asymmetric_visibility/cpp_protected.phpt b/Zend/tests/asymmetric_visibility/cpp_protected.phpt
index f13351e32003..d94b359eabd3 100644
--- a/Zend/tests/asymmetric_visibility/cpp_protected.phpt
+++ b/Zend/tests/asymmetric_visibility/cpp_protected.phpt
@@ -25,7 +25,7 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBarPrivate('baz');
@@ -37,6 +37,6 @@ var_dump($foo->bar);
?>
--EXPECT--
string(3) "bar"
-Cannot modify protected(set) property Foo::$bar from global scope
+Error: Cannot modify protected(set) property Foo::$bar from global scope
string(3) "baz"
string(3) "qux"
diff --git a/Zend/tests/asymmetric_visibility/dim_add.phpt b/Zend/tests/asymmetric_visibility/dim_add.phpt
index f7bf0ceaf939..4eecd6a3eba8 100644
--- a/Zend/tests/asymmetric_visibility/dim_add.phpt
+++ b/Zend/tests/asymmetric_visibility/dim_add.phpt
@@ -16,7 +16,7 @@ $foo = new Foo();
try {
$foo->bars[] = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->bars);
@@ -25,7 +25,7 @@ var_dump($foo->bars);
?>
--EXPECT--
-Cannot indirectly modify private(set) property Foo::$bars from global scope
+Error: Cannot indirectly modify private(set) property Foo::$bars from global scope
array(0) {
}
array(1) {
diff --git a/Zend/tests/asymmetric_visibility/private.phpt b/Zend/tests/asymmetric_visibility/private.phpt
index 48e557c6e87d..61687d2d1b32 100644
--- a/Zend/tests/asymmetric_visibility/private.phpt
+++ b/Zend/tests/asymmetric_visibility/private.phpt
@@ -29,7 +29,7 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBar('baz');
@@ -38,7 +38,7 @@ var_dump($foo->bar);
try {
$foo->baz = 'baz2';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBaz('baz2');
@@ -48,14 +48,14 @@ $child = new FooChild();
try {
$child->modifyBar('baz');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
string(3) "bar"
-Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from global scope
string(3) "baz"
-Cannot modify private(set) property Foo::$baz from global scope
+Error: Cannot modify private(set) property Foo::$baz from global scope
string(4) "baz2"
-Cannot modify private(set) property Foo::$bar from scope FooChild
+Error: Cannot modify private(set) property Foo::$bar from scope FooChild
diff --git a/Zend/tests/asymmetric_visibility/protected.phpt b/Zend/tests/asymmetric_visibility/protected.phpt
index 49a39b399362..4ada4a06cac4 100644
--- a/Zend/tests/asymmetric_visibility/protected.phpt
+++ b/Zend/tests/asymmetric_visibility/protected.phpt
@@ -33,7 +33,7 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBarPrivate('baz');
@@ -45,7 +45,7 @@ var_dump($foo->bar);
try {
$foo->baz = 'baz';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setbazPrivate('baz2');
@@ -58,9 +58,9 @@ var_dump($foo->baz);
?>
--EXPECT--
string(3) "bar"
-Cannot modify protected(set) property Foo::$bar from global scope
+Error: Cannot modify protected(set) property Foo::$bar from global scope
string(3) "baz"
string(3) "qux"
-Cannot modify protected(set) property Foo::$baz from global scope
+Error: Cannot modify protected(set) property Foo::$baz from global scope
string(4) "baz2"
string(4) "baz3"
diff --git a/Zend/tests/asymmetric_visibility/readonly.phpt b/Zend/tests/asymmetric_visibility/readonly.phpt
index e02d36907998..457d4d178fe3 100644
--- a/Zend/tests/asymmetric_visibility/readonly.phpt
+++ b/Zend/tests/asymmetric_visibility/readonly.phpt
@@ -23,7 +23,7 @@ class C extends P {
try {
$this->pPrivate = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$this->pProtected = 1;
$this->pPublic = 1;
@@ -35,17 +35,17 @@ function test() {
try {
$p->pDefault = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->pPrivate = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->pProtected = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$p->pPublic = 1;
}
@@ -56,7 +56,7 @@ test();
?>
--EXPECT--
-Cannot modify private(set) property P::$pPrivate from scope C
-Cannot modify protected(set) readonly property P::$pDefault from global scope
-Cannot modify private(set) property P::$pPrivate from global scope
-Cannot modify protected(set) readonly property P::$pProtected from global scope
+Error: Cannot modify private(set) property P::$pPrivate from scope C
+Error: Cannot modify protected(set) readonly property P::$pDefault from global scope
+Error: Cannot modify private(set) property P::$pPrivate from global scope
+Error: Cannot modify protected(set) readonly property P::$pProtected from global scope
diff --git a/Zend/tests/asymmetric_visibility/reference.phpt b/Zend/tests/asymmetric_visibility/reference.phpt
index ae5271418282..40c2ddbdf68d 100644
--- a/Zend/tests/asymmetric_visibility/reference.phpt
+++ b/Zend/tests/asymmetric_visibility/reference.phpt
@@ -18,7 +18,7 @@ try {
$bar = &$foo->bar;
$bar++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->bar);
@@ -27,6 +27,6 @@ var_dump($foo->bar);
?>
--EXPECT--
-Cannot indirectly modify private(set) property Foo::$bar from global scope
+Error: Cannot indirectly modify private(set) property Foo::$bar from global scope
int(0)
int(1)
diff --git a/Zend/tests/asymmetric_visibility/reference_2.phpt b/Zend/tests/asymmetric_visibility/reference_2.phpt
index d4ef6c03a788..d119d5adccbd 100644
--- a/Zend/tests/asymmetric_visibility/reference_2.phpt
+++ b/Zend/tests/asymmetric_visibility/reference_2.phpt
@@ -15,16 +15,16 @@ function test($c) {
try {
test(new C());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(new C());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot indirectly modify private(set) property C::$prop from global scope
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
diff --git a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
index 8c10d10f77a4..0819dc1d6299 100644
--- a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
+++ b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
@@ -19,18 +19,18 @@ var_dump($foo->bar);
try {
$c();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
($c->bindTo(null, Bar::class))();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->bar);
?>
--EXPECT--
int(2)
-Cannot modify private(set) property Foo::$bar from global scope
-Cannot modify private(set) property Foo::$bar from scope Bar
+Error: Cannot modify private(set) property Foo::$bar from global scope
+Error: Cannot modify private(set) property Foo::$bar from scope Bar
int(2)
diff --git a/Zend/tests/asymmetric_visibility/static_props.phpt b/Zend/tests/asymmetric_visibility/static_props.phpt
index f47dcf70b6f7..31fc3c5010a4 100644
--- a/Zend/tests/asymmetric_visibility/static_props.phpt
+++ b/Zend/tests/asymmetric_visibility/static_props.phpt
@@ -30,7 +30,7 @@ function test() {
try {
C::$prop = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
@@ -40,21 +40,21 @@ function test() {
try {
++C::$prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
C::$prop++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
C::$prop += str_repeat('a', 10);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
@@ -62,7 +62,7 @@ function test() {
$ref = &C::$prop;
$ref++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
@@ -71,14 +71,14 @@ function test() {
C::$prop = &$ref;
$ref++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
C::$prop2[] = 'foo';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop2);
@@ -97,20 +97,20 @@ test();
?>
--EXPECTF--
-Cannot modify private(set) property C::$prop from global scope
+Error: Cannot modify private(set) property C::$prop from global scope
int(1)
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop2 from global scope
+Error: Cannot indirectly modify private(set) property C::$prop2 from global scope
array(0) {
}
array(1) {
@@ -123,20 +123,20 @@ object(stdClass)#%d (1) {
}
Repeat:
-Cannot modify private(set) property C::$prop from global scope
+Error: Cannot modify private(set) property C::$prop from global scope
int(1)
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop from global scope
+Error: Cannot indirectly modify private(set) property C::$prop from global scope
int(3)
-Cannot indirectly modify private(set) property C::$prop2 from global scope
+Error: Cannot indirectly modify private(set) property C::$prop2 from global scope
array(0) {
}
array(1) {
diff --git a/Zend/tests/asymmetric_visibility/unset.phpt b/Zend/tests/asymmetric_visibility/unset.phpt
index 3fd3d7673081..cbb950d9ed50 100644
--- a/Zend/tests/asymmetric_visibility/unset.phpt
+++ b/Zend/tests/asymmetric_visibility/unset.phpt
@@ -37,7 +37,7 @@ $foo->setBar('bar');
try {
unset($foo->bar);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->bar ?? 'unset');
@@ -53,15 +53,15 @@ $foo->setSecret('beep');
try {
$foo->unsetSecret();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->secret ?? 'unset');
?>
--EXPECT--
-Cannot unset protected(set) property Foo::$bar from global scope
+Error: Cannot unset protected(set) property Foo::$bar from global scope
string(3) "bar"
string(5) "unset"
string(5) "unset"
-Cannot unset private(set) property Foo::$secret from scope FooChild
+Error: Cannot unset private(set) property Foo::$secret from scope FooChild
string(4) "beep"
diff --git a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
index d81f4d3891bf..45d2839af78a 100644
--- a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
+++ b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
@@ -18,19 +18,19 @@ $c = new C();
try {
$c->setBar(1);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->setBar(1);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($c);
?>
--EXPECTF--
-Typed property P::$bar must not be accessed before initialization
-Typed property P::$bar must not be accessed before initialization
+Error: Typed property P::$bar must not be accessed before initialization
+Error: Typed property P::$bar must not be accessed before initialization
object(C)#%d (0) {
["bar"]=>
uninitialized(string)
diff --git a/Zend/tests/attributes/003_ast_nodes.phpt b/Zend/tests/attributes/003_ast_nodes.phpt
index 854edf3d63c1..b9e970275d89 100644
--- a/Zend/tests/attributes/003_ast_nodes.phpt
+++ b/Zend/tests/attributes/003_ast_nodes.phpt
@@ -72,13 +72,13 @@ var_dump(count($attr));
try {
$attr[0]->getArguments();
} catch (\Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$attr[0]->newInstance();
} catch (\Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -104,5 +104,5 @@ array(1) {
}
int(1)
-string(30) "Class "MissingClass" not found"
-string(30) "Class "MissingClass" not found"
+Error: Class "MissingClass" not found
+Error: Class "MissingClass" not found
diff --git a/Zend/tests/attributes/005_objects.phpt b/Zend/tests/attributes/005_objects.phpt
index 2b08db838b27..22f16af06b89 100644
--- a/Zend/tests/attributes/005_objects.phpt
+++ b/Zend/tests/attributes/005_objects.phpt
@@ -31,7 +31,7 @@ $ref = new \ReflectionFunction(#[A1] function () { });
try {
$ref->getAttributes()[0]->newInstance();
} catch (\ArgumentCountError $e) {
- var_dump('ERROR 1', $e->getMessage());
+ echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -41,7 +41,7 @@ $ref = new \ReflectionFunction(#[A1([])] function () { });
try {
$ref->getAttributes()[0]->newInstance();
} catch (\TypeError $e) {
- var_dump('ERROR 2', $e->getMessage());
+ echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -51,7 +51,7 @@ $ref = new \ReflectionFunction(#[A2] function () { });
try {
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
- var_dump('ERROR 3', $e->getMessage());
+ echo 'ERROR 3: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -67,7 +67,7 @@ $ref = new \ReflectionFunction(#[A3] function () { });
try {
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
- var_dump('ERROR 4', $e->getMessage());
+ echo 'ERROR 4: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -79,7 +79,7 @@ $ref = new \ReflectionFunction(#[A5] function () { });
try {
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
- var_dump('ERROR 6', $e->getMessage());
+ echo 'ERROR 6: ', $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -88,17 +88,12 @@ string(2) "A1"
string(4) "test"
int(50)
-string(7) "ERROR 1"
-string(%d) "Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected"
+ERROR 1: ArgumentCountError: Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected
-string(7) "ERROR 2"
-string(%d) "A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36"
+ERROR 2: TypeError: A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36
-string(7) "ERROR 3"
-string(30) "Attribute class "A2" not found"
+ERROR 3: Error: Attribute class "A2" not found
-string(7) "ERROR 4"
-string(51) "Call to private A3::__construct() from global scope"
+ERROR 4: Error: Call to private A3::__construct() from global scope
-string(7) "ERROR 6"
-string(55) "Attempting to use non-attribute class "A5" as attribute"
+ERROR 6: Error: Attempting to use non-attribute class "A5" as attribute
diff --git a/Zend/tests/attributes/006_filter.phpt b/Zend/tests/attributes/006_filter.phpt
index 2924e6ed7982..938f7d8890df 100644
--- a/Zend/tests/attributes/006_filter.phpt
+++ b/Zend/tests/attributes/006_filter.phpt
@@ -57,7 +57,7 @@ $ref = new \ReflectionFunction(function () { });
try {
$ref->getAttributes(A1::class, 3);
} catch (\Error $e) {
- var_dump('ERROR 1', $e->getMessage());
+ echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
}
$ref = new \ReflectionFunction(function () { });
@@ -65,7 +65,7 @@ $ref = new \ReflectionFunction(function () { });
try {
$ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
} catch (\Error $e) {
- var_dump('ERROR 2', $e->getMessage());
+ echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -106,7 +106,5 @@ Array
[2] => A3
)
-string(7) "ERROR 1"
-string(103) "ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag"
-string(7) "ERROR 2"
-string(34) "Class "SomeMissingClass" not found"
+ERROR 1: ValueError: ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag
+ERROR 2: Error: Class "SomeMissingClass" not found
diff --git a/Zend/tests/attributes/013_class_scope.phpt b/Zend/tests/attributes/013_class_scope.phpt
index ff16bb7b8225..f3938a274995 100644
--- a/Zend/tests/attributes/013_class_scope.phpt
+++ b/Zend/tests/attributes/013_class_scope.phpt
@@ -47,7 +47,7 @@ $attr = $ref->getMethod('foo')->getAttributes()[0];
try {
$attr->getArguments();
} catch (\Error $e) {
- var_dump('ERROR 1', $e->getMessage());
+ echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -108,8 +108,7 @@ Array
[0] => C2
[1] => bar
)
-string(7) "ERROR 1"
-string(28) "Undefined constant self::FOO"
+ERROR 1: Error: Undefined constant self::FOO
bool(true)
string(3) "bar"
diff --git a/Zend/tests/attributes/020_userland_attribute_validation.phpt b/Zend/tests/attributes/020_userland_attribute_validation.phpt
index ce2acb26db16..008a892c707c 100644
--- a/Zend/tests/attributes/020_userland_attribute_validation.phpt
+++ b/Zend/tests/attributes/020_userland_attribute_validation.phpt
@@ -20,7 +20,7 @@ var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_CLASS, $attr-
try {
$attr->newInstance();
} catch (\Throwable $e) {
- var_dump('ERROR 1', $e->getMessage());
+ echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -32,7 +32,7 @@ var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_FUNCTION, $at
try {
$attr->newInstance();
} catch (\Throwable $e) {
- var_dump('ERROR 2', $e->getMessage());
+ echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -55,14 +55,12 @@ string(2) "A1"
string(2) "A1"
bool(true)
bool(false)
-string(7) "ERROR 1"
-string(70) "Attribute "A1" cannot target class (allowed targets: function, method)"
+ERROR 1: Error: Attribute "A1" cannot target class (allowed targets: function, method)
string(2) "A1"
bool(true)
bool(true)
-string(7) "ERROR 2"
-string(35) "Attribute "A1" must not be repeated"
+ERROR 2: Error: Attribute "A1" must not be repeated
string(2) "A2"
bool(true)
diff --git a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
index 70e4fdb7f338..e2dfab866d37 100644
--- a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
+++ b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
@@ -12,9 +12,9 @@ class Foo {}
try {
(new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Attribute::__construct(): Argument #1 ($flags) must be of type int, string given
+Error: Attribute::__construct(): Argument #1 ($flags) must be of type int, string given
diff --git a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
index efaa969af827..2268e716ff79 100644
--- a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
+++ b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
@@ -12,9 +12,9 @@ class Foo { }
try {
var_dump((new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Invalid attribute flags specified
+Error: Invalid attribute flags specified
diff --git a/Zend/tests/attributes/023_ast_node_in_validation.phpt b/Zend/tests/attributes/023_ast_node_in_validation.phpt
index 063a6b7e815d..12c03ea7adaa 100644
--- a/Zend/tests/attributes/023_ast_node_in_validation.phpt
+++ b/Zend/tests/attributes/023_ast_node_in_validation.phpt
@@ -12,9 +12,9 @@ class Bar { }
try {
var_dump((new ReflectionClass(Bar::class))->getAttributes()[0]->newInstance());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Class "Foo" not found
+Error: Class "Foo" not found
diff --git a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
index b1efb538b328..06a1e47b399c 100644
--- a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
@@ -66,7 +66,7 @@ foreach ($cases as $r) {
try {
$attributes[1]->newInstance();
} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
index 68d1ae43bd46..743a59eeaa42 100644
--- a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
@@ -20,7 +20,7 @@ var_dump($attributes);
try {
$attributes[1]->newInstance();
} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
index 63add9e445a9..1935befaa6fe 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
@@ -33,7 +33,7 @@ foreach ($cases as $r) {
try {
$attributes[1]->newInstance();
} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
index 0571024f19ce..8bf19fc478a7 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
@@ -33,7 +33,7 @@ foreach ($cases as $r) {
try {
$attributes[1]->newInstance();
} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
index f5fedb4ee68e..73680499f1a9 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
@@ -28,7 +28,7 @@ foreach ($cases as $r) {
try {
$attributes[1]->newInstance();
} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
index e3cfe9d1c109..82e499e49428 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
@@ -26,7 +26,7 @@ foreach ($cases as $r) {
try {
$attributes[1]->newInstance();
} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt
index ab84d4724226..9b9fc61a919f 100644
--- a/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt
+++ b/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt
@@ -21,16 +21,16 @@ class Clazz {
try {
Clazz::TEST;
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
Clazz::TEST3;
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Caught: Constant Clazz::TEST is deprecated, from itself
-Caught: Constant Clazz::TEST2 is deprecated
+ErrorException: Constant Clazz::TEST is deprecated, from itself
+ErrorException: Constant Clazz::TEST2 is deprecated
diff --git a/Zend/tests/attributes/deprecated/constants/const_messages.phpt b/Zend/tests/attributes/deprecated/constants/const_messages.phpt
index 1cf8b11af156..2ced4e06fd29 100644
--- a/Zend/tests/attributes/deprecated/constants/const_messages.phpt
+++ b/Zend/tests/attributes/deprecated/constants/const_messages.phpt
@@ -46,4 +46,3 @@ Deprecated: Constant DeprecatedConst5 is deprecated since 1.0, use DEPRECATED_CO
Deprecated: Constant DeprecatedConst6 is deprecated since 1.0 in %s on line %d
6
-
diff --git a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
index f749293d8fac..1775d35b8886 100644
--- a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
+++ b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
@@ -19,16 +19,16 @@ const TEST3 = 1;
try {
TEST;
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
TEST3;
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Caught: Constant TEST is deprecated, from itself
-Caught: Constant TEST2 is deprecated
+ErrorException: Constant TEST is deprecated, from itself
+ErrorException: Constant TEST2 is deprecated
diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
index af816aea6c4b..99d4cc741651 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
@@ -15,7 +15,7 @@ function test() {
try {
test();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
eval(<<<'CODE'
@@ -28,7 +28,7 @@ CODE);
try {
test2();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
class Clazz {
@@ -42,7 +42,7 @@ try {
$cls = new Clazz();
$cls->test();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$closure = #[\Deprecated("convert to exception")] function () {
@@ -52,7 +52,7 @@ $closure = #[\Deprecated("convert to exception")] function () {
try {
$closure();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
class Constructor {
@@ -65,7 +65,7 @@ class Constructor {
try {
new Constructor();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
class Destructor {
@@ -78,14 +78,14 @@ class Destructor {
try {
new Destructor();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-Caught: Function test() is deprecated, convert to exception
-Caught: Function test2() is deprecated, convert to exception
-Caught: Method Clazz::test() is deprecated, convert to exception
-Caught: Function {closure:%s:%d}() is deprecated, convert to exception
-Caught: Method Constructor::__construct() is deprecated, convert to exception
-Caught: Method Destructor::__destruct() is deprecated, convert to exception
+ErrorException: Function test() is deprecated, convert to exception
+ErrorException: Function test2() is deprecated, convert to exception
+ErrorException: Method Clazz::test() is deprecated, convert to exception
+ErrorException: Function {closure:%s:%d}() is deprecated, convert to exception
+ErrorException: Method Constructor::__construct() is deprecated, convert to exception
+ErrorException: Method Destructor::__destruct() is deprecated, convert to exception
diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
index 3c9c9ec952fc..8d31ba611f72 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
@@ -13,9 +13,9 @@ function test() {}
try {
$x = test();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Caught: Function test() is deprecated
+ErrorException: Function test() is deprecated
diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
index 734a30795e5b..d9bbf64070e4 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
@@ -13,9 +13,9 @@ function test($dummy) {}
try {
$x = test(new stdClass());
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Caught: Function test() is deprecated
+ErrorException: Function test() is deprecated
diff --git a/Zend/tests/attributes/nodiscard/002.phpt b/Zend/tests/attributes/nodiscard/002.phpt
index 618aa2f6286d..c690212a52ad 100644
--- a/Zend/tests/attributes/nodiscard/002.phpt
+++ b/Zend/tests/attributes/nodiscard/002.phpt
@@ -41,4 +41,3 @@ __callStatic(test)
Warning: The return value of method Clazz::__invoke() should either be used or intentionally ignored by casting it as (void) in %s on line %d
__invoke(foo)
-
diff --git a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
index 51179b26ab19..2d834e02ed75 100644
--- a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
+++ b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
@@ -15,7 +15,7 @@ function test(): int {
try {
test();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
#[\NoDiscard]
@@ -26,10 +26,10 @@ function test2(): stdClass {
try {
test2();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Caught: The return value of function test() should either be used or intentionally ignored by casting it as (void)
-Caught: The return value of function test2() should either be used or intentionally ignored by casting it as (void)
+ErrorException: The return value of function test() should either be used or intentionally ignored by casting it as (void)
+ErrorException: The return value of function test2() should either be used or intentionally ignored by casting it as (void)
diff --git a/Zend/tests/attributes/ossfuzz371445205.phpt b/Zend/tests/attributes/ossfuzz371445205.phpt
index 17e4f529a2a0..95f6c4ac80f4 100644
--- a/Zend/tests/attributes/ossfuzz371445205.phpt
+++ b/Zend/tests/attributes/ossfuzz371445205.phpt
@@ -10,8 +10,8 @@ $attr=(new ReflectionClass(Test1::class))->getAttributes()[0];
try {
$attr->newInstance();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unknown named parameter $notinterned
+Error: Unknown named parameter $notinterned
diff --git a/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt b/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt
index f6ea383c397e..82f75742c774 100644
--- a/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt
+++ b/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt
@@ -5,4 +5,3 @@ Calling debug_print_backtrace() from main script
debug_print_backtrace();
?>
--EXPECT--
-
diff --git a/Zend/tests/bind_static_exception.phpt b/Zend/tests/bind_static_exception.phpt
index c374130aaecf..9d76b5b6bbd5 100644
--- a/Zend/tests/bind_static_exception.phpt
+++ b/Zend/tests/bind_static_exception.phpt
@@ -11,8 +11,8 @@ try {
$new = new Test;
static $new;
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Foo
+Exception: Foo
diff --git a/Zend/tests/bitwise_not_precision_exception.phpt b/Zend/tests/bitwise_not_precision_exception.phpt
index e28bf8f4e17b..ad98aa40ca63 100644
--- a/Zend/tests/bitwise_not_precision_exception.phpt
+++ b/Zend/tests/bitwise_not_precision_exception.phpt
@@ -8,8 +8,8 @@ set_error_handler(function($_, $msg) {
try {
var_dump(~INF);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-The float INF is not representable as an int, cast occurred
+Exception: The float INF is not representable as an int, cast occurred
diff --git a/Zend/tests/bug26229.phpt b/Zend/tests/bug26229.phpt
index 5914b977ef51..fad131dae9f2 100644
--- a/Zend/tests/bug26229.phpt
+++ b/Zend/tests/bug26229.phpt
@@ -21,8 +21,8 @@ try
}
catch(Exception $e)
{
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
+Exception: Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
diff --git a/Zend/tests/bug31098.phpt b/Zend/tests/bug31098.phpt
index 862fc6fc46dc..319d97dbcb34 100644
--- a/Zend/tests/bug31098.phpt
+++ b/Zend/tests/bug31098.phpt
@@ -20,7 +20,7 @@ echo isset($simpleString->wrong)?"bug\n":"ok\n";
try {
echo isset($simpleString["wrong"])?"bug\n":"ok\n";
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo isset($simpleString[-20])?"bug\n":"ok\n";
echo isset($simpleString[0])?"ok\n":"bug\n";
@@ -31,14 +31,14 @@ echo $simpleString->wrong === null?"ok\n":"bug\n";
try {
echo $simpleString["wrong"] === "B"?"ok\n":"bug\n";
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo $simpleString["0"] === "B"?"ok\n":"bug\n";
try {
/* This must not affect the string value */
$simpleString["wrong"] = "f";
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo $simpleString["0"] === "B"?"ok\n":"bug\n";
?>
@@ -59,7 +59,7 @@ ok
Warning: Attempt to read property "wrong" on string in %s on line %d
ok
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
ok
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
ok
diff --git a/Zend/tests/bug31720.phpt b/Zend/tests/bug31720.phpt
index 083ea78a0116..e0246f62a363 100644
--- a/Zend/tests/bug31720.phpt
+++ b/Zend/tests/bug31720.phpt
@@ -7,9 +7,9 @@ $array = array('at least one element');
try {
array_walk($array, array($nonesuchvar,'show'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $nonesuchvar in %s on line %d
-array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
diff --git a/Zend/tests/bug33996.phpt b/Zend/tests/bug33996.phpt
index d5ec3386d6e9..849667e9eed8 100644
--- a/Zend/tests/bug33996.phpt
+++ b/Zend/tests/bug33996.phpt
@@ -22,16 +22,16 @@ function NormalTest($a)
try {
NormalTest();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
FooTest();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
FooTest(new Foo());
?>
--EXPECTF--
-Exception: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
-Exception: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
+ArgumentCountError: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
+ArgumentCountError: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
Hello!
diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt
index b066ecd7abb9..7a58fe7da222 100644
--- a/Zend/tests/bug37811.phpt
+++ b/Zend/tests/bug37811.phpt
@@ -20,7 +20,7 @@ var_dump(Baz);
try {
var_dump((string) Baz);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -30,4 +30,4 @@ object(TestClass)#1 (0) {
string(3) "Foo"
object(stdClass)#2 (0) {
}
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
diff --git a/Zend/tests/bug44660.phpt b/Zend/tests/bug44660.phpt
index 02588c44b9d1..a956e8ce0509 100644
--- a/Zend/tests/bug44660.phpt
+++ b/Zend/tests/bug44660.phpt
@@ -12,35 +12,35 @@ echo "\n--> direct assignment:\n";
try {
$a->p = $s;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> increment:\n";
try {
$a->p++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> reference assignment:\n";
try {
$a->p =& $s;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> reference assignment:\n";
try {
$s =& $a->p;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> indexed assignment:\n";
try {
$a->p[0] = $s;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> Confirm assignments have had no impact:\n";
@@ -51,19 +51,19 @@ var_dump($a);
Warning: Attempt to read property "p" on true in %s on line %d
--> direct assignment:
-Attempt to assign property "p" on true
+Error: Attempt to assign property "p" on true
--> increment:
-Attempt to increment/decrement property "p" on true
+Error: Attempt to increment/decrement property "p" on true
--> reference assignment:
-Attempt to modify property "p" on true
+Error: Attempt to modify property "p" on true
--> reference assignment:
-Attempt to modify property "p" on true
+Error: Attempt to modify property "p" on true
--> indexed assignment:
-Attempt to modify property "p" on true
+Error: Attempt to modify property "p" on true
--> Confirm assignments have had no impact:
bool(true)
diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt
index 7f0ae66debfe..f4ed3e098d17 100644
--- a/Zend/tests/bug46106.phpt
+++ b/Zend/tests/bug46106.phpt
@@ -18,10 +18,10 @@ $x = new ReflectionFunction('str_pad');
try {
test($x);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECT--
-str_pad() expects at least 2 arguments, 1 given
+ArgumentCountError: str_pad() expects at least 2 arguments, 1 given
DONE
diff --git a/Zend/tests/bug47836.phpt b/Zend/tests/bug47836.phpt
index 15afc68c48de..1776ad625ffb 100644
--- a/Zend/tests/bug47836.phpt
+++ b/Zend/tests/bug47836.phpt
@@ -7,13 +7,13 @@ $arr[PHP_INT_MAX] = 1;
try {
$arr[] = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($arr);
?>
--EXPECTF--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
array(1) {
[%d]=>
int(1)
diff --git a/Zend/tests/bug49893.phpt b/Zend/tests/bug49893.phpt
index 0832b0b0ef4c..8dced2673d70 100644
--- a/Zend/tests/bug49893.phpt
+++ b/Zend/tests/bug49893.phpt
@@ -7,7 +7,7 @@ class A {
try {
throw new Exception("2");
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -21,9 +21,9 @@ class B {
try {
$b = new B();
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-2
-1
+Exception: 2
+Exception: 1
diff --git a/Zend/tests/bug52041.phpt b/Zend/tests/bug52041.phpt
index 7debab3f8beb..1ae4642f9496 100644
--- a/Zend/tests/bug52041.phpt
+++ b/Zend/tests/bug52041.phpt
@@ -9,32 +9,32 @@ function foo() {
try {
foo()->a = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a += 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b += 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
foo()[0] = 1;
@@ -48,22 +48,22 @@ var_dump(foo());
?>
--EXPECTF--
Warning: Undefined variable $x in %s on line %d
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
Warning: Undefined variable $x in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $x in %s on line %d
-Attempt to increment/decrement property "a" on null
+Error: Attempt to increment/decrement property "a" on null
Warning: Undefined variable $x in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $x in %s on line %d
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
Warning: Undefined variable $x in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $x in %s on line %d
diff --git a/Zend/tests/bug52355.phpt b/Zend/tests/bug52355.phpt
index 0c207be2beeb..fa7fd110bd6c 100644
--- a/Zend/tests/bug52355.phpt
+++ b/Zend/tests/bug52355.phpt
@@ -13,7 +13,7 @@ var_dump($foo);
try {
var_dump(1.0 / -0.0);
} catch (\DivisionByZeroError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -21,4 +21,4 @@ try {
float(-0)
float(-0)
float(-0)
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/Zend/tests/bug52614.phpt b/Zend/tests/bug52614.phpt
index 8c2bc0dc9e0e..c0c7a3d4d189 100644
--- a/Zend/tests/bug52614.phpt
+++ b/Zend/tests/bug52614.phpt
@@ -55,7 +55,7 @@ var_dump($foo->a3);
try {
$foo->f4()->a = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->o1);
@@ -76,7 +76,7 @@ array(0) {
}
array(0) {
}
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
NULL
object(stdClass)#3 (1) {
["a"]=>
diff --git a/Zend/tests/bug53432.phpt b/Zend/tests/bug53432.phpt
index aa2a6015f51f..92949c4afc7a 100644
--- a/Zend/tests/bug53432.phpt
+++ b/Zend/tests/bug53432.phpt
@@ -19,7 +19,7 @@ $str = '';
try {
var_dump($str['foo'] = 'a');
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($str);
@@ -27,7 +27,7 @@ $str = '';
try {
var_dump($str[] = 'a');
} catch (Error $e) {
- echo "Error: {$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);
@@ -35,7 +35,7 @@ $str = '';
try {
var_dump($str[0] += 1);
} catch (Error $e) {
- echo "Error: {$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);
@@ -43,7 +43,7 @@ $str = '';
try {
var_dump($str[0][0] = 'a');
} catch (Error $e) {
- echo "Error: {$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);
@@ -57,7 +57,7 @@ string(6) " a"
Warning: Illegal string offset -1 in %s on line %d
NULL
string(0) ""
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(0) ""
Error: [] operator not supported for strings
string(0) ""
diff --git a/Zend/tests/bug63882.phpt b/Zend/tests/bug63882.phpt
index 801f1b1e07ea..53b62e9937b4 100644
--- a/Zend/tests/bug63882.phpt
+++ b/Zend/tests/bug63882.phpt
@@ -12,9 +12,9 @@ $testobj2->x = $testobj2;
try {
var_dump($testobj1 == $testobj2);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Nesting level too deep - recursive dependency?
+Error: Nesting level too deep - recursive dependency?
diff --git a/Zend/tests/bug65784.phpt b/Zend/tests/bug65784.phpt
index 78a7cd12d90c..1ef513b109e1 100644
--- a/Zend/tests/bug65784.phpt
+++ b/Zend/tests/bug65784.phpt
@@ -18,7 +18,7 @@ try {
var_dump($foo);
} catch (Exception $e) {
do {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
} while ($e = $e->getPrevious());
}
@@ -55,7 +55,7 @@ function foo3() {
$bar = foo3();
?>
--EXPECTF--
-string(9) "not catch"
+Exception: not catch
NULL
Fatal error: Uncaught Exception: not caught in %sbug65784.php:42
diff --git a/Zend/tests/bug69017.phpt b/Zend/tests/bug69017.phpt
index d1608ebbf9db..a527b1748a5c 100644
--- a/Zend/tests/bug69017.phpt
+++ b/Zend/tests/bug69017.phpt
@@ -19,7 +19,7 @@ c1::$a2[] = 1;
try {
c1::$a3[] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(c1::$a1);
@@ -27,7 +27,7 @@ var_dump(c1::$a2);
var_dump(c1::$a3);
?>
--EXPECTF--
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
array(2) {
[1]=>
string(3) "one"
diff --git a/Zend/tests/bug69315.phpt b/Zend/tests/bug69315.phpt
index 82017c055241..c5aa58d8c1bf 100644
--- a/Zend/tests/bug69315.phpt
+++ b/Zend/tests/bug69315.phpt
@@ -10,41 +10,41 @@ var_dump(is_callable("strlen"));
try {
var_dump(strlen("xxx"));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(defined("PHP_VERSION"));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(constant("PHP_VERSION"));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(call_user_func("strlen"));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(is_string("xxx"));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(is_string());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(false)
bool(false)
-Call to undefined function strlen()
-Call to undefined function defined()
-Call to undefined function constant()
-Call to undefined function call_user_func()
-Call to undefined function is_string()
-Call to undefined function is_string()
+Error: Call to undefined function strlen()
+Error: Call to undefined function defined()
+Error: Call to undefined function constant()
+Error: Call to undefined function call_user_func()
+Error: Call to undefined function is_string()
+Error: Call to undefined function is_string()
diff --git a/Zend/tests/bug70083.phpt b/Zend/tests/bug70083.phpt
index 691e6a412510..ed3a4b9e0f5b 100644
--- a/Zend/tests/bug70083.phpt
+++ b/Zend/tests/bug70083.phpt
@@ -16,13 +16,13 @@ $foo = new foo;
try {
$foo->i = &noref();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo);
?>
--EXPECT--
-Cannot assign by reference to overloaded object
+Error: Cannot assign by reference to overloaded object
object(foo)#1 (1) {
["var":"foo":private]=>
NULL
diff --git a/Zend/tests/bug70089.phpt b/Zend/tests/bug70089.phpt
index 3a8e7d8e783e..72b0563b202b 100644
--- a/Zend/tests/bug70089.phpt
+++ b/Zend/tests/bug70089.phpt
@@ -8,28 +8,28 @@ function dummy($a) {
try {
chr(0)[0][] = 1;
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset(chr(0)[0][0]);
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
eval("function runtimetest(&\$a) {} ");
try {
runtimetest(chr(0)[0]);
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
++chr(0)[0];
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(36) "Cannot use string offset as an array"
-string(36) "Cannot use string offset as an array"
-string(47) "Cannot create references to/from string offsets"
-string(41) "Cannot increment/decrement string offsets"
+Error: Cannot use string offset as an array
+Error: Cannot use string offset as an array
+Error: Cannot create references to/from string offsets
+Error: Cannot increment/decrement string offsets
diff --git a/Zend/tests/bug70689.phpt b/Zend/tests/bug70689.phpt
index d1895cf39e54..3ea7844b13ba 100644
--- a/Zend/tests/bug70689.phpt
+++ b/Zend/tests/bug70689.phpt
@@ -14,7 +14,7 @@ set_error_handler(function($errno, $errstr) {
try {
foo();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/bug70895.phpt b/Zend/tests/bug70895.phpt
index afbea1c91d76..d661c1c259fc 100644
--- a/Zend/tests/bug70895.phpt
+++ b/Zend/tests/bug70895.phpt
@@ -6,20 +6,20 @@ Bug #70895 null ptr deref and segfault with crafted callable
try {
array_map("%n", 0);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_map("%n %i", 0);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_map("%n %i aoeu %f aoeu %p", 0);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name
diff --git a/Zend/tests/bug70898.phpt b/Zend/tests/bug70898.phpt
index d3d2cf79a9d1..f2426f6c1ac4 100644
--- a/Zend/tests/bug70898.phpt
+++ b/Zend/tests/bug70898.phpt
@@ -9,8 +9,8 @@ function m($f,$a){
try {
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name
diff --git a/Zend/tests/bug70914.phpt b/Zend/tests/bug70914.phpt
index 73a43a5600dc..db4609f31bec 100644
--- a/Zend/tests/bug70914.phpt
+++ b/Zend/tests/bug70914.phpt
@@ -10,8 +10,8 @@ $st = $db->query('SELECT 1');
try {
$re = $st->fetchObject('%Z');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
+TypeError: PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
diff --git a/Zend/tests/bug70918.phpt b/Zend/tests/bug70918.phpt
index 54f3a3c72a80..7d521b631ead 100644
--- a/Zend/tests/bug70918.phpt
+++ b/Zend/tests/bug70918.phpt
@@ -5,43 +5,43 @@ Bug #70918 (Segfault using static outside of class scope)
try {
static::x;
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
parent::x;
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::x;
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new static;
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
static::x();
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
static::$i;
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(52) "Cannot access "static" when no class scope is active"
-string(52) "Cannot access "parent" when no class scope is active"
-string(50) "Cannot access "self" when no class scope is active"
-string(52) "Cannot access "static" when no class scope is active"
-string(52) "Cannot access "static" when no class scope is active"
-string(52) "Cannot access "static" when no class scope is active"
+Error: Cannot access "static" when no class scope is active
+Error: Cannot access "parent" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "static" when no class scope is active
+Error: Cannot access "static" when no class scope is active
+Error: Cannot access "static" when no class scope is active
diff --git a/Zend/tests/bug71196.phpt b/Zend/tests/bug71196.phpt
index ca25f9f4fcba..511f8ac2d8ca 100644
--- a/Zend/tests/bug71196.phpt
+++ b/Zend/tests/bug71196.phpt
@@ -6,8 +6,8 @@ try {
$a = "1";
[1, (y().$a.$a) . ($a.$a)];
} catch (Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(30) "Call to undefined function y()"
+Error: Call to undefined function y()
diff --git a/Zend/tests/bug71572.phpt b/Zend/tests/bug71572.phpt
index f4079e55f89a..cb20d8fe8e93 100644
--- a/Zend/tests/bug71572.phpt
+++ b/Zend/tests/bug71572.phpt
@@ -7,28 +7,28 @@ $str = "abc";
try {
var_dump($str[0] = "");
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($str[1] = "");
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($str[3] = "");
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($str[10] = "");
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($str);
?>
--EXPECT--
-Cannot assign an empty string to a string offset
-Cannot assign an empty string to a string offset
-Cannot assign an empty string to a string offset
-Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
+Error: Cannot assign an empty string to a string offset
string(3) "abc"
diff --git a/Zend/tests/bug72038.phpt b/Zend/tests/bug72038.phpt
index f5491f1b9d6f..25e00463eeb3 100644
--- a/Zend/tests/bug72038.phpt
+++ b/Zend/tests/bug72038.phpt
@@ -7,13 +7,13 @@ try {
test($foo = new stdClass);
var_dump($foo);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test($bar = 2);
var_dump($bar);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
test($baz = &$bar);
@@ -25,6 +25,6 @@ function test(&$param) {
?>
--EXPECT--
-test(): Argument #1 ($param) could not be passed by reference
-test(): Argument #1 ($param) could not be passed by reference
+Error: test(): Argument #1 ($param) could not be passed by reference
+Error: test(): Argument #1 ($param) could not be passed by reference
int(1)
diff --git a/Zend/tests/bug72107.phpt b/Zend/tests/bug72107.phpt
index f65b1422691f..e2e067c2a083 100644
--- a/Zend/tests/bug72107.phpt
+++ b/Zend/tests/bug72107.phpt
@@ -9,8 +9,8 @@ function test($a) {
try {
test(1);
} catch (\Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-func_get_args() expects exactly 0 arguments, 4 given
+ArgumentCountError: func_get_args() expects exactly 0 arguments, 4 given
diff --git a/Zend/tests/bug74084.phpt b/Zend/tests/bug74084.phpt
index 36239438c689..b73add39ef5d 100644
--- a/Zend/tests/bug74084.phpt
+++ b/Zend/tests/bug74084.phpt
@@ -9,29 +9,29 @@ unset($$A);
try {
$$A -= $$B['a'] = &$$C;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($$A);
try {
$$A *= $$B['a'] = &$$C;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($$A);
try {
$$A /= $$B['a'] = &$$C;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($$A);
try {
$$A **= $$B['a'] = &$$C;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: array - array
-Unsupported operand types: array * array
-Unsupported operand types: array / array
-Unsupported operand types: array ** array
+TypeError: Unsupported operand types: array - array
+TypeError: Unsupported operand types: array * array
+TypeError: Unsupported operand types: array / array
+TypeError: Unsupported operand types: array ** array
diff --git a/Zend/tests/bug75218.phpt b/Zend/tests/bug75218.phpt
index ddbde62a5269..f9d7e7ebf1f0 100644
--- a/Zend/tests/bug75218.phpt
+++ b/Zend/tests/bug75218.phpt
@@ -7,7 +7,7 @@ function try_eval($code) {
try {
eval($code);
} catch (CompileError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -18,7 +18,7 @@ try_eval('declare(encoding=[]);');
?>
--EXPECT--
-Multiple final modifiers are not allowed
-Multiple access type modifiers are not allowed
-__HALT_COMPILER() can only be used from the outermost scope
-Encoding must be a literal
+CompileError: Multiple final modifiers are not allowed
+CompileError: Multiple access type modifiers are not allowed
+CompileError: __HALT_COMPILER() can only be used from the outermost scope
+CompileError: Encoding must be a literal
diff --git a/Zend/tests/bug75252.phpt b/Zend/tests/bug75252.phpt
index b4e0a1b5bdc3..36c04a6bc976 100644
--- a/Zend/tests/bug75252.phpt
+++ b/Zend/tests/bug75252.phpt
@@ -13,16 +13,16 @@ CODE;
try {
eval($code);
} catch (ParseError $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
eval($code);
} catch (ParseError $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(41) "syntax error, unexpected identifier "FOO""
-string(41) "syntax error, unexpected identifier "FOO""
+ParseError: syntax error, unexpected identifier "FOO"
+ParseError: syntax error, unexpected identifier "FOO"
diff --git a/Zend/tests/bug75921.phpt b/Zend/tests/bug75921.phpt
index ab82c85840c4..925236104e87 100644
--- a/Zend/tests/bug75921.phpt
+++ b/Zend/tests/bug75921.phpt
@@ -6,7 +6,7 @@ Bug #75921: Inconsistent error when creating stdObject from empty variable
try {
$null->a = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
@@ -14,7 +14,7 @@ unset($null);
try {
$null->a['hello'] = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
@@ -22,7 +22,7 @@ unset($null);
try {
$null->a->b = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
@@ -30,7 +30,7 @@ unset($null);
try {
$null->a['hello']->b = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
@@ -38,30 +38,30 @@ unset($null);
try {
$null->a->b['hello'] = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
?>
--EXPECTF--
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
Warning: Undefined variable $null in %s on line %d
NULL
diff --git a/Zend/tests/bug76869.phpt b/Zend/tests/bug76869.phpt
index a19d2dfedbfe..afd60595970b 100644
--- a/Zend/tests/bug76869.phpt
+++ b/Zend/tests/bug76869.phpt
@@ -16,8 +16,8 @@ $b = new B();
try {
var_dump($b->f());
} catch (Throwable $e) {
- echo "Exception: ", $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Call to protected method B::f() from global scope
+Error: Call to protected method B::f() from global scope
diff --git a/Zend/tests/bug78154.phpt b/Zend/tests/bug78154.phpt
index 94f49b224e6d..3ce187a865f5 100644
--- a/Zend/tests/bug78154.phpt
+++ b/Zend/tests/bug78154.phpt
@@ -8,7 +8,7 @@ namespace {
var_dump(similar_text('a', 'a', $c=0x44444444));
var_dump($c);
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
namespace Foo {
@@ -16,11 +16,11 @@ namespace Foo {
var_dump(similar_text('a', 'a', $d=0x44444444));
var_dump($d);
} catch (\Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECT--
-Exception: similar_text(): Argument #3 ($percent) could not be passed by reference
-Exception: similar_text(): Argument #3 ($percent) could not be passed by reference
+Error: similar_text(): Argument #3 ($percent) could not be passed by reference
+Error: similar_text(): Argument #3 ($percent) could not be passed by reference
diff --git a/Zend/tests/bug78182.phpt b/Zend/tests/bug78182.phpt
index a751e953bbff..b7f9fe9b7195 100644
--- a/Zend/tests/bug78182.phpt
+++ b/Zend/tests/bug78182.phpt
@@ -7,10 +7,10 @@ $propName = 'prop';
try {
$$varName->$propName =& $$varName;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($var);
?>
--EXPECT--
-Attempt to modify property "prop" on null
+Error: Attempt to modify property "prop" on null
NULL
diff --git a/Zend/tests/bug78531.phpt b/Zend/tests/bug78531.phpt
index b818afb79a86..23a5388d6b5d 100644
--- a/Zend/tests/bug78531.phpt
+++ b/Zend/tests/bug78531.phpt
@@ -5,33 +5,33 @@ Bug #78531 (Crash when using undefined variable as object)
try {
$u1->a += 5;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x = ++$u2->a;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x = $u3->a++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$u4->a->a += 5;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $u1 in %s on line %d
-Attempt to assign property "a" on null
+Error: Attempt to assign property "a" on null
Warning: Undefined variable $u2 in %s on line %d
-Attempt to increment/decrement property "a" on null
+Error: Attempt to increment/decrement property "a" on null
Warning: Undefined variable $u3 in %s on line %d
-Attempt to increment/decrement property "a" on null
+Error: Attempt to increment/decrement property "a" on null
Warning: Undefined variable $u4 in %s on line %d
-Attempt to modify property "a" on null
+Error: Attempt to modify property "a" on null
diff --git a/Zend/tests/bug78810.phpt b/Zend/tests/bug78810.phpt
index 0fd56f0ceda5..4952c562c936 100644
--- a/Zend/tests/bug78810.phpt
+++ b/Zend/tests/bug78810.phpt
@@ -11,15 +11,15 @@ $test = new Test;
try {
$test->i++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->i += 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Typed property Test::$i must not be accessed before initialization
-Typed property Test::$i must not be accessed before initialization
+Error: Typed property Test::$i must not be accessed before initialization
+Error: Typed property Test::$i must not be accessed before initialization
diff --git a/Zend/tests/bug78926.phpt b/Zend/tests/bug78926.phpt
index a59692748b2d..6b44ff58e7ed 100644
--- a/Zend/tests/bug78926.phpt
+++ b/Zend/tests/bug78926.phpt
@@ -12,11 +12,11 @@ spl_autoload_register(function($class) {
try {
class B extends A {}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(class_exists('B', false));
?>
--EXPECT--
-Class "A" not found
+Error: Class "A" not found
bool(false)
diff --git a/Zend/tests/bug79599.phpt b/Zend/tests/bug79599.phpt
index 57e5332431f5..32e65087c2c3 100644
--- a/Zend/tests/bug79599.phpt
+++ b/Zend/tests/bug79599.phpt
@@ -14,14 +14,14 @@ function test2(){
try{
test1();
}catch(\Exception $e){
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try{
test2();
}catch(\Exception $e){
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(21) "Undefined variable $b"
-string(21) "Undefined variable $c"
+Exception: Undefined variable $b
+Exception: Undefined variable $c
diff --git a/Zend/tests/bug79947.phpt b/Zend/tests/bug79947.phpt
index 0593eacfd6c4..457c0603671b 100644
--- a/Zend/tests/bug79947.phpt
+++ b/Zend/tests/bug79947.phpt
@@ -7,11 +7,11 @@ $key = [];
try {
$array[$key] += [$key];
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($array);
?>
--EXPECT--
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
array(0) {
}
diff --git a/Zend/tests/bug80972.phpt b/Zend/tests/bug80972.phpt
index 01d1a98952da..4abce01f934e 100644
--- a/Zend/tests/bug80972.phpt
+++ b/Zend/tests/bug80972.phpt
@@ -20,7 +20,7 @@ try {
$string[(string) 10e120] = 'E';
var_dump($string);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
/* This same bug also permits to modify the first byte of a string even if
@@ -29,13 +29,13 @@ try {
/* This must not affect the string value */
$string["wrong"] = "f";
} catch (\Throwable $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($string);
?>
--EXPECT--
Float casted to string compile
-Cannot access offset of type string on string
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(34) "Here is some text for good measure"
diff --git a/Zend/tests/bug81159.phpt b/Zend/tests/bug81159.phpt
index d16deafbf5b9..54a85a160122 100644
--- a/Zend/tests/bug81159.phpt
+++ b/Zend/tests/bug81159.phpt
@@ -8,14 +8,14 @@ $o = new stdClass();
try {
$s[$o] = 'A';
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($s[$o]);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access offset of type stdClass on string
-Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type stdClass on string
diff --git a/Zend/tests/call_to_abstract_method_args.phpt b/Zend/tests/call_to_abstract_method_args.phpt
index cbbc276d2ce2..c5c6dc67d88d 100644
--- a/Zend/tests/call_to_abstract_method_args.phpt
+++ b/Zend/tests/call_to_abstract_method_args.phpt
@@ -10,17 +10,17 @@ abstract class Test {
try {
Test::method(new stdClass);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$ret = Test::method(new stdClass);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot call abstract method Test::method()
-Cannot call abstract method Test::method()
+Error: Cannot call abstract method Test::method()
+Error: Cannot call abstract method Test::method()
diff --git a/Zend/tests/call_to_deprecated_function_args.phpt b/Zend/tests/call_to_deprecated_function_args.phpt
index bbae74746080..7574bbffbee4 100644
--- a/Zend/tests/call_to_deprecated_function_args.phpt
+++ b/Zend/tests/call_to_deprecated_function_args.phpt
@@ -12,21 +12,21 @@ set_error_handler(function($code, $msg) {
try {
zend_test_deprecated(new stdClass);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$ret = zend_test_deprecated(new stdClass());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$fn = 'zend_test_deprecated';
$fn(new stdClass);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ret = new stdClass;
@@ -34,12 +34,12 @@ try {
$fn = 'zend_test_deprecated';
$ret = $fn(new stdClass);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Function zend_test_deprecated() is deprecated
-Function zend_test_deprecated() is deprecated
-Function zend_test_deprecated() is deprecated
-Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
+Error: Function zend_test_deprecated() is deprecated
diff --git a/Zend/tests/call_user_functions/call_user_func_001.phpt b/Zend/tests/call_user_functions/call_user_func_001.phpt
index 9497d305e2cd..46203b279dde 100644
--- a/Zend/tests/call_user_functions/call_user_func_001.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_001.phpt
@@ -25,17 +25,17 @@ namespace testing {
try {
call_user_func(array(new $class, 'priv'), 'foobar');
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array(new $class, 'prot'), 'foobar');
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECT--
string(6) "foobar"
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv()
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot()
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv()
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot()
diff --git a/Zend/tests/call_user_functions/call_user_func_002.phpt b/Zend/tests/call_user_functions/call_user_func_002.phpt
index 443334cd2375..9e739610eb60 100644
--- a/Zend/tests/call_user_functions/call_user_func_002.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_002.phpt
@@ -10,32 +10,32 @@ spl_autoload_register(function ($class) {
try {
call_user_func(array('foo', 'bar'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array('', 'bar'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array($foo, 'bar'));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array($foo, ''));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
string(3) "foo"
-call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
-call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found
Warning: Undefined variable $foo in %s on line %d
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
Warning: Undefined variable $foo in %s on line %d
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
diff --git a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt
index 1849d8fc19bc..31cb8626b5d4 100644
--- a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt
@@ -9,7 +9,7 @@ try {
$len = [];
call_user_func_array('var_dump', array_slice($array, 0, $len));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$len = 2.0;
@@ -20,7 +20,7 @@ call_user_func_array('var_dump', array_slice($array, 1, $len));
?>
--EXPECT--
-array_slice(): Argument #3 ($length) must be of type ?int, array given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, array given
int(1)
int(2)
int(2)
diff --git a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt
index f73c8bbb2467..c45f966e564f 100644
--- a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt
@@ -10,14 +10,14 @@ try {
$len = [];
call_user_func_array('var_dump', array_slice($array, 0, $len));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$len = 2.0;
call_user_func_array('var_dump', array_slice($array, 0, $len));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$len = null;
@@ -25,7 +25,7 @@ call_user_func_array('var_dump', array_slice($array, 1, $len));
?>
--EXPECT--
-array_slice(): Argument #3 ($length) must be of type ?int, array given
-array_slice(): Argument #3 ($length) must be of type ?int, float given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, array given
+TypeError: array_slice(): Argument #3 ($length) must be of type ?int, float given
int(2)
int(3)
diff --git a/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt b/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt
index 785a6e35e907..7a748acff546 100644
--- a/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt
@@ -11,8 +11,8 @@ $drv = new drv;
try {
call_user_func_array(array($drv, 'func'), null);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-call_user_func_array(): Argument #2 ($args) must be of type array, null given
+TypeError: call_user_func_array(): Argument #2 ($args) must be of type array, null given
diff --git a/Zend/tests/call_user_functions/call_user_func_by_ref.phpt b/Zend/tests/call_user_functions/call_user_func_by_ref.phpt
index 4596269549a1..c94ddda854ea 100644
--- a/Zend/tests/call_user_functions/call_user_func_by_ref.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_by_ref.phpt
@@ -8,10 +8,10 @@ function test(Type &$ref) {
try {
call_user_func('test', 0);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: test(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
-test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d
diff --git a/Zend/tests/callable_param_exception_leak.phpt b/Zend/tests/callable_param_exception_leak.phpt
index 090279971080..010cc8bb38a2 100644
--- a/Zend/tests/callable_param_exception_leak.phpt
+++ b/Zend/tests/callable_param_exception_leak.phpt
@@ -8,8 +8,8 @@ spl_autoload_register(function ($class) {
try {
array_map('A::b', []);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Failed
+Exception: Failed
diff --git a/Zend/tests/class_name/class_name_as_scalar_error_007.phpt b/Zend/tests/class_name/class_name_as_scalar_error_007.phpt
index a550cdd2b06d..4b2dca548399 100644
--- a/Zend/tests/class_name/class_name_as_scalar_error_007.phpt
+++ b/Zend/tests/class_name/class_name_as_scalar_error_007.phpt
@@ -6,15 +6,15 @@ Cannot access self::class when no class scope is active
try {
var_dump(self::class);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump([self::class]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot use "self" in the global scope
-Cannot use "self" in the global scope
+Error: Cannot use "self" in the global scope
+Error: Cannot use "self" in the global scope
diff --git a/Zend/tests/class_name/class_on_object.phpt b/Zend/tests/class_name/class_on_object.phpt
index dab09872901b..d5a48fb62246 100644
--- a/Zend/tests/class_name/class_on_object.phpt
+++ b/Zend/tests/class_name/class_on_object.phpt
@@ -17,7 +17,7 @@ function test() {
try {
test();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -25,4 +25,4 @@ try {
string(8) "stdClass"
string(8) "stdClass"
string(8) "stdClass"
-Cannot use "::class" on null
+TypeError: Cannot use "::class" on null
diff --git a/Zend/tests/clone/ast.phpt b/Zend/tests/clone/ast.phpt
index e482854a9448..1bbf24e0b130 100644
--- a/Zend/tests/clone/ast.phpt
+++ b/Zend/tests/clone/ast.phpt
@@ -9,86 +9,86 @@ $x = new stdClass();
try {
assert(false && $y = clone $x);
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone($x));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone($x, ));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone($x, [ "foo" => $foo, "bar" => $bar ]));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone($x, $array));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone($x, $array, $extraParameter, $trailingComma, ));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone(object: $x, withProperties: [ "foo" => $foo, "bar" => $bar ]));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone($x, withProperties: [ "foo" => $foo, "bar" => $bar ]));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone(object: $x));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone(object: $x, [ "foo" => $foo, "bar" => $bar ]));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone(...["object" => $x, "withProperties" => [ "foo" => $foo, "bar" => $bar ]]));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && $y = clone(...));
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert(false && ($y = \clone($x)))
-assert(false && ($y = \clone($x)))
-assert(false && ($y = \clone($x)))
-assert(false && ($y = \clone($x, ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone($x, $array)))
-assert(false && ($y = \clone($x, $array, $extraParameter, $trailingComma)))
-assert(false && ($y = \clone(object: $x, withProperties: ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone($x, withProperties: ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone(object: $x)))
-assert(false && ($y = \clone(object: $x, ['foo' => $foo, 'bar' => $bar])))
-assert(false && ($y = \clone(...['object' => $x, 'withProperties' => ['foo' => $foo, 'bar' => $bar]])))
-assert(false && ($y = \clone(...)))
+AssertionError: assert(false && ($y = \clone($x)))
+AssertionError: assert(false && ($y = \clone($x)))
+AssertionError: assert(false && ($y = \clone($x)))
+AssertionError: assert(false && ($y = \clone($x, ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone($x, $array)))
+AssertionError: assert(false && ($y = \clone($x, $array, $extraParameter, $trailingComma)))
+AssertionError: assert(false && ($y = \clone(object: $x, withProperties: ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone($x, withProperties: ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone(object: $x)))
+AssertionError: assert(false && ($y = \clone(object: $x, ['foo' => $foo, 'bar' => $bar])))
+AssertionError: assert(false && ($y = \clone(...['object' => $x, 'withProperties' => ['foo' => $foo, 'bar' => $bar]])))
+AssertionError: assert(false && ($y = \clone(...)))
diff --git a/Zend/tests/clone/bug36071.phpt b/Zend/tests/clone/bug36071.phpt
index e1a4baa7226e..0d5f58d6ebf6 100644
--- a/Zend/tests/clone/bug36071.phpt
+++ b/Zend/tests/clone/bug36071.phpt
@@ -7,7 +7,7 @@ error_reporting=4095
try {
$a = clone 0;
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
diff --git a/Zend/tests/clone/bug42817.phpt b/Zend/tests/clone/bug42817.phpt
index b5f53222d7ee..96e548a09ca4 100644
--- a/Zend/tests/clone/bug42817.phpt
+++ b/Zend/tests/clone/bug42817.phpt
@@ -5,7 +5,7 @@ Bug #42817 (clone() on a non-object does not result in a fatal error)
try {
$a = clone(null);
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
diff --git a/Zend/tests/clone/bug42818.phpt b/Zend/tests/clone/bug42818.phpt
index 08ba05fcfaa2..1f2780a7ccf1 100644
--- a/Zend/tests/clone/bug42818.phpt
+++ b/Zend/tests/clone/bug42818.phpt
@@ -5,7 +5,7 @@ Bug #42818 ($foo = clone(array()); leaks memory)
try {
$foo = clone(array());
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
diff --git a/Zend/tests/clone/clone_001.phpt b/Zend/tests/clone/clone_001.phpt
index 91fa6f551176..b40c65820b3e 100644
--- a/Zend/tests/clone/clone_001.phpt
+++ b/Zend/tests/clone/clone_001.phpt
@@ -6,7 +6,7 @@ Using clone statement on non-object
try {
$a = clone array();
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_003.phpt b/Zend/tests/clone/clone_003.phpt
index b8bb2833dc25..78208f9a50b9 100644
--- a/Zend/tests/clone/clone_003.phpt
+++ b/Zend/tests/clone/clone_003.phpt
@@ -6,7 +6,7 @@ Using clone statement on undefined variable
try {
$a = clone $b;
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_002.phpt b/Zend/tests/clone/clone_with_002.phpt
index 8b86e64c76aa..8f9686d37180 100644
--- a/Zend/tests/clone/clone_with_002.phpt
+++ b/Zend/tests/clone/clone_with_002.phpt
@@ -41,25 +41,25 @@ var_dump($c->m2());
try {
var_dump($c->m3());
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(clone($p, [ 'b' => 'inaccessible' ]));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(clone($p, [ 'd' => 'inaccessible' ]));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump((new Unrelated())->m3($p));
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_005.phpt b/Zend/tests/clone/clone_with_005.phpt
index 55ffb2423d7e..acc130ee9b87 100644
--- a/Zend/tests/clone/clone_with_005.phpt
+++ b/Zend/tests/clone/clone_with_005.phpt
@@ -42,7 +42,7 @@ $c = new Clazz();
try {
var_dump(clone($c, [ 'hooked' => 'updated', 'maxLength' => 'abcdef', 'minLength' => 'abc' ]));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo PHP_EOL;
@@ -50,7 +50,7 @@ echo PHP_EOL;
try {
var_dump(clone($c, [ 'hooked' => 'updated', 'minLength' => 'abc', 'maxLength' => 'abcdef' ]));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_006.phpt b/Zend/tests/clone/clone_with_006.phpt
index 7b0b8520b8a8..ca8755c5fe11 100644
--- a/Zend/tests/clone/clone_with_006.phpt
+++ b/Zend/tests/clone/clone_with_006.phpt
@@ -8,7 +8,7 @@ $x = new stdClass();
try {
var_dump(clone($x, 1));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_008.phpt b/Zend/tests/clone/clone_with_008.phpt
index aa2c639fb7f1..1a8557edf619 100644
--- a/Zend/tests/clone/clone_with_008.phpt
+++ b/Zend/tests/clone/clone_with_008.phpt
@@ -21,7 +21,7 @@ var_dump(clone($c, [ 'a' => "with" ]));
try {
var_dump(clone($c, [ 'b' => "with" ]));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_010.phpt b/Zend/tests/clone/clone_with_010.phpt
index 29ecf714fc49..424c017a3c85 100644
--- a/Zend/tests/clone/clone_with_010.phpt
+++ b/Zend/tests/clone/clone_with_010.phpt
@@ -6,13 +6,13 @@ Clone with native classes
try {
var_dump(clone(new \Random\Engine\Secure(), [ 'with' => "something" ]));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(clone(new \Random\Engine\Xoshiro256StarStar(), [ 'with' => "something" ]));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_011.phpt b/Zend/tests/clone/clone_with_011.phpt
index 5f8e99bb65f2..bd3e0200aac1 100644
--- a/Zend/tests/clone/clone_with_011.phpt
+++ b/Zend/tests/clone/clone_with_011.phpt
@@ -10,7 +10,7 @@ class Foo {
try {
var_dump(clone(new Foo(), ["\0Foo\0bar" => 'updated']));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_012.phpt b/Zend/tests/clone/clone_with_012.phpt
index e24f0adad7c4..fb906afbba9f 100644
--- a/Zend/tests/clone/clone_with_012.phpt
+++ b/Zend/tests/clone/clone_with_012.phpt
@@ -21,7 +21,7 @@ var_dump(clone($f, ['foo' => 'foo updated in clone-with']));
try {
var_dump(clone($f, ['foo' => 'foo updated in clone-with', 'bar' => 'bar updated in clone-with']));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_013.phpt b/Zend/tests/clone/clone_with_013.phpt
index 13f246325585..515c46f44741 100644
--- a/Zend/tests/clone/clone_with_013.phpt
+++ b/Zend/tests/clone/clone_with_013.phpt
@@ -11,7 +11,7 @@ $with = ['x' => &$ref];
try {
var_dump(clone($x, $with));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
unset($ref);
@@ -19,7 +19,7 @@ unset($ref);
try {
var_dump(clone($x, $with));
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/clone/clone_with_014.phpt b/Zend/tests/clone/clone_with_014.phpt
index bfbee40e163c..4e90b22dc66e 100644
--- a/Zend/tests/clone/clone_with_014.phpt
+++ b/Zend/tests/clone/clone_with_014.phpt
@@ -19,7 +19,7 @@ var_dump($test);
try {
$test->b = 4;
} catch (Error $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($test);
diff --git a/Zend/tests/closures/bug79778.phpt b/Zend/tests/closures/bug79778.phpt
index fa2e2771dcec..8ed00d1cac33 100644
--- a/Zend/tests/closures/bug79778.phpt
+++ b/Zend/tests/closures/bug79778.phpt
@@ -12,7 +12,7 @@ print_r($closure1);
try {
$closure1();
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($closure1);
@@ -49,7 +49,7 @@ Closure Object
)
)
-Undefined constant "CONST_REF"
+Error: Undefined constant "CONST_REF"
object(Closure)#%d (4) {
["name"]=>
string(%d) "{closure:%s:%d}"
diff --git a/Zend/tests/closures/closure_015.phpt b/Zend/tests/closures/closure_015.phpt
index f6903ebdb183..4e89471fbff2 100644
--- a/Zend/tests/closures/closure_015.phpt
+++ b/Zend/tests/closures/closure_015.phpt
@@ -7,15 +7,15 @@ $x = function() { return 1; };
try {
print (string) $x;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
print $x;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Object of class Closure could not be converted to string
-Object of class Closure could not be converted to string
+Error: Object of class Closure could not be converted to string
+Error: Object of class Closure could not be converted to string
diff --git a/Zend/tests/closures/closure_021.phpt b/Zend/tests/closures/closure_021.phpt
index 95ff7d889f9e..d9a23bbf2e4a 100644
--- a/Zend/tests/closures/closure_021.phpt
+++ b/Zend/tests/closures/closure_021.phpt
@@ -14,9 +14,9 @@ $foo = function() {
try {
$foo();
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(5) "test!"
+Exception: test!
diff --git a/Zend/tests/closures/closure_027.phpt b/Zend/tests/closures/closure_027.phpt
index 6e467856100a..8e5a53a67921 100644
--- a/Zend/tests/closures/closure_027.phpt
+++ b/Zend/tests/closures/closure_027.phpt
@@ -16,7 +16,7 @@ $a = function($x) use ($y) {};
try {
test($a);
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
test(new stdclass);
@@ -28,7 +28,7 @@ object(stdClass)#%d (0) {
NULL
Warning: Undefined variable $y in %s on line %d
-Exception: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Fatal error: Uncaught TypeError: test(): Argument #1 ($a) must be of type Closure, stdClass given, called in %s:%d
Stack trace:
diff --git a/Zend/tests/closures/closure_031.phpt b/Zend/tests/closures/closure_031.phpt
index 19f3dc6e3212..611cf9a62352 100644
--- a/Zend/tests/closures/closure_031.phpt
+++ b/Zend/tests/closures/closure_031.phpt
@@ -11,7 +11,7 @@ $foo = function() {
try {
var_dump($foo->a);
} catch (Error $ex) {
- echo "Error: {$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/Zend/tests/closures/closure_040.phpt b/Zend/tests/closures/closure_040.phpt
index b733bdbef053..f265ceb7ef6a 100644
--- a/Zend/tests/closures/closure_040.phpt
+++ b/Zend/tests/closures/closure_040.phpt
@@ -27,13 +27,13 @@ $cas = $a->getStaticIncrementor();
try {
$ca->bindTo($a, array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$cas->bindTo($a, 'A');
?>
--EXPECTF--
-Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given
+TypeError: Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given
Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d
diff --git a/Zend/tests/closures/closure_059.phpt b/Zend/tests/closures/closure_059.phpt
index d8f7590db902..d101d4ab2720 100644
--- a/Zend/tests/closures/closure_059.phpt
+++ b/Zend/tests/closures/closure_059.phpt
@@ -20,20 +20,20 @@ call_user_func(array($f,"__invoke"), $a);
try {
$f($b);
} catch (Error $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$f->__invoke($b);
} catch (Error $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array($f,"__invoke"), $b);
} catch (Error $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d
-Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
-Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
+TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
+TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given
diff --git a/Zend/tests/closures/closure_063.phpt b/Zend/tests/closures/closure_063.phpt
index b53f370eb4bf..f46cdd976c88 100644
--- a/Zend/tests/closures/closure_063.phpt
+++ b/Zend/tests/closures/closure_063.phpt
@@ -9,4 +9,4 @@ Closure::fromCallable('foo')->bindTo(new stdClass);
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/Zend/tests/closures/closure_array_key_error.phpt b/Zend/tests/closures/closure_array_key_error.phpt
index 8b6441e3c25a..6a21331fa99c 100644
--- a/Zend/tests/closures/closure_array_key_error.phpt
+++ b/Zend/tests/closures/closure_array_key_error.phpt
@@ -6,9 +6,9 @@ Trying to use lambda as array key
try {
var_dump(array(function() { } => 1));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access offset of type Closure on array
+TypeError: Cannot access offset of type Closure on array
diff --git a/Zend/tests/closures/closure_array_offset_error.phpt b/Zend/tests/closures/closure_array_offset_error.phpt
index 8958237b0eb8..d6cfe3a71bb2 100644
--- a/Zend/tests/closures/closure_array_offset_error.phpt
+++ b/Zend/tests/closures/closure_array_offset_error.phpt
@@ -6,9 +6,9 @@ Trying to use lambda in array offset
try {
$test[function(){}] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access offset of type Closure on array
+TypeError: Cannot access offset of type Closure on array
diff --git a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
index e87abf8c9061..d5226ee597b0 100644
--- a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
+++ b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
@@ -14,7 +14,7 @@ try {
function () { }
);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -26,16 +26,16 @@ try {
class {}
);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(!#[Attr(static function ($foo) {
+AssertionError: assert(!#[Attr(static function ($foo) {
echo $foo;
})] function () {
})
-assert(!new #[Attr(static function ($foo) {
+AssertionError: assert(!new #[Attr(static function ($foo) {
echo $foo;
})] class {
})
diff --git a/Zend/tests/closures/closure_from_callable_error.phpt b/Zend/tests/closures/closure_from_callable_error.phpt
index c6fd1ff831f5..5d14ee396220 100644
--- a/Zend/tests/closures/closure_from_callable_error.phpt
+++ b/Zend/tests/closures/closure_from_callable_error.phpt
@@ -14,7 +14,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
@@ -27,7 +27,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Cannot access privateInstance method'."\n";
@@ -39,7 +39,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'SubClass cannot access private instance method'."\n";
@@ -51,7 +51,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Cannot access private static function of instance'."\n";
@@ -63,7 +63,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Cannot access private static method statically'."\n";
@@ -75,7 +75,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Cannot access private static method statically with colon scheme'."\n";
@@ -87,7 +87,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Non-existent method should fail'."\n";
@@ -99,7 +99,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Non-existent class should fail'."\n";
@@ -111,7 +111,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Non-existent function should fail'."\n";
@@ -123,7 +123,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
@@ -137,7 +137,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Subclass cannot closure over parent private static method'."\n";
@@ -150,7 +150,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Function scope cannot closure over protected instance method'."\n";
@@ -162,7 +162,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Function scope cannot closure over private instance method'."\n";
@@ -174,7 +174,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo 'Access private instance method of parent object through "self::" to parent method'."\n";
@@ -187,7 +187,7 @@ catch (\TypeError $te) {
//This is the expected outcome.
}
catch (\Throwable $t) {
- echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n";
+ echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n";
}
echo "OK\n";
diff --git a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
index 24df1d186a43..b93372074dee 100644
--- a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
+++ b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
@@ -12,9 +12,9 @@ try {
$fn = Closure::fromCallable(['A', 'method']);
$fn();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Failed to create closure from callable: non-static method A::method() cannot be called statically
+TypeError: Failed to create closure from callable: non-static method A::method() cannot be called statically
diff --git a/Zend/tests/closures/closure_get_current.phpt b/Zend/tests/closures/closure_get_current.phpt
index 3024ff355b55..df58f69cd723 100644
--- a/Zend/tests/closures/closure_get_current.phpt
+++ b/Zend/tests/closures/closure_get_current.phpt
@@ -24,7 +24,7 @@ function fail() {
try {
fail();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function foo() {
@@ -34,7 +34,7 @@ function foo() {
try {
foo(...)();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -60,5 +60,5 @@ int(9)
int(10)
int(10)
int(11)
-Current function is not a closure
-Current function is not a closure
+Error: Current function is not a closure
+Error: Current function is not a closure
diff --git a/Zend/tests/closures/closure_instantiate.phpt b/Zend/tests/closures/closure_instantiate.phpt
index de3b866cb82e..2143c3674cbc 100644
--- a/Zend/tests/closures/closure_instantiate.phpt
+++ b/Zend/tests/closures/closure_instantiate.phpt
@@ -10,12 +10,12 @@ try {
$x = new Closure();
} catch (Exception $e) {
// Instantiating a closure is an error, not an exception, so we shouldn't see this
- echo 'EXCEPTION: ', $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} catch (Throwable $e) {
// This is the message that we should see for a caught error
- echo 'ERROR: ', $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-ERROR: Instantiation of class Closure is not allowed
+Error: Instantiation of class Closure is not allowed
diff --git a/Zend/tests/closures/closure_write_prop.phpt b/Zend/tests/closures/closure_write_prop.phpt
index 8dbf18e67041..909202fd7268 100644
--- a/Zend/tests/closures/closure_write_prop.phpt
+++ b/Zend/tests/closures/closure_write_prop.phpt
@@ -14,9 +14,9 @@ $a = new A;
try {
$c = $a->getFn()->b = new stdClass;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot create dynamic property Closure::$b
+Error: Cannot create dynamic property Closure::$b
diff --git a/Zend/tests/coalesce/assign_coalesce_002.phpt b/Zend/tests/coalesce/assign_coalesce_002.phpt
index 0b2c5374bc7a..e26337a7b9d1 100644
--- a/Zend/tests/coalesce/assign_coalesce_002.phpt
+++ b/Zend/tests/coalesce/assign_coalesce_002.phpt
@@ -21,7 +21,7 @@ $ary = [];
try {
$ary[id($foo)] ??= do_throw("ex1");
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($ary);
@@ -47,7 +47,7 @@ $ary = new AA;
try {
$ary[new Dtor][id($foo)] ??= $bar;
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo);
@@ -66,19 +66,19 @@ $ary = ["foo" => new AA2];
try {
$ary[id($foo)][new Dtor] ??= $bar;
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo);
?>
--EXPECT--
id(foo)
-ex1
+Exception: ex1
array(0) {
}
id(foo)
-dtor
+Exception: dtor
string(3) "foo"
id(foo)
-dtor
+Exception: dtor
string(3) "foo"
diff --git a/Zend/tests/compound_assign_with_numeric_strings.phpt b/Zend/tests/compound_assign_with_numeric_strings.phpt
index c6cee53d95c9..6102a1bffe70 100644
--- a/Zend/tests/compound_assign_with_numeric_strings.phpt
+++ b/Zend/tests/compound_assign_with_numeric_strings.phpt
@@ -12,7 +12,7 @@ try {
$n <<= $n;
var_dump($n);
} catch (ArithmeticError $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$n = "65";
@@ -24,7 +24,7 @@ try {
$n >>= $n;
var_dump($n);
} catch (ArithmeticError $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$n = "0";
@@ -32,7 +32,7 @@ try{
$n %= $n;
var_dump($n);
} catch (DivisionByZeroError $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$n = "-1";
@@ -41,11 +41,8 @@ var_dump($n);
?>
--EXPECT--
int(0)
-
-Exception: Bit shift by negative number
+ArithmeticError: Bit shift by negative number
int(0)
-
-Exception: Bit shift by negative number
-
-Exception: Modulo by zero
+ArithmeticError: Bit shift by negative number
+DivisionByZeroError: Modulo by zero
int(0)
diff --git a/Zend/tests/concat/bug81705.phpt b/Zend/tests/concat/bug81705.phpt
index 1c00b1c77d4b..86d897b1db3b 100644
--- a/Zend/tests/concat/bug81705.phpt
+++ b/Zend/tests/concat/bug81705.phpt
@@ -16,4 +16,4 @@ var_dump($my_var);
?>
--EXPECT--
error
-string(6) "aArray"
\ No newline at end of file
+string(6) "aArray"
diff --git a/Zend/tests/constant_arrays.phpt b/Zend/tests/constant_arrays.phpt
index eecc76847545..0c0db6a55f69 100644
--- a/Zend/tests/constant_arrays.phpt
+++ b/Zend/tests/constant_arrays.phpt
@@ -34,7 +34,7 @@ $recursive[0] = &$recursive;
try {
define('RECURSION', $recursive);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
@@ -104,4 +104,4 @@ array(1) {
object(stdClass)#1 (0) {
}
}
-define(): Argument #2 ($value) cannot be a recursive array
+ValueError: define(): Argument #2 ($value) cannot be a recursive array
diff --git a/Zend/tests/constants/008.phpt b/Zend/tests/constants/008.phpt
index 14e074e5d30a..c863c26d85c9 100644
--- a/Zend/tests/constants/008.phpt
+++ b/Zend/tests/constants/008.phpt
@@ -6,7 +6,7 @@ define() tests
try {
var_dump(define(array(1,2,3,4,5), 1));
} catch (TypeError $e) {
- echo "TypeError: ", $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(define("TRUE", 1));
diff --git a/Zend/tests/constants/018.phpt b/Zend/tests/constants/018.phpt
index f348c2b556cb..622711452f3f 100644
--- a/Zend/tests/constants/018.phpt
+++ b/Zend/tests/constants/018.phpt
@@ -6,7 +6,7 @@ constant() tests
try {
var_dump(constant(""));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
define("TEST_CONST", 1);
@@ -18,7 +18,7 @@ var_dump(constant("TEST_CONST2"));
echo "Done\n";
?>
--EXPECT--
-Undefined constant ""
+Error: Undefined constant ""
int(1)
string(4) "test"
Done
diff --git a/Zend/tests/constants/bug44827.phpt b/Zend/tests/constants/bug44827.phpt
index 8e51087480bd..22ed2821ceb5 100644
--- a/Zend/tests/constants/bug44827.phpt
+++ b/Zend/tests/constants/bug44827.phpt
@@ -6,16 +6,16 @@ Bug #44827 (define() allows :: in constant names)
try {
define('foo::bar', 1);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
define('::', 1);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-define(): Argument #1 ($constant_name) cannot be a class constant
-define(): Argument #1 ($constant_name) cannot be a class constant
+ValueError: define(): Argument #1 ($constant_name) cannot be a class constant
+ValueError: define(): Argument #1 ($constant_name) cannot be a class constant
diff --git a/Zend/tests/constants/bug51791.phpt b/Zend/tests/constants/bug51791.phpt
index 7675cb564d26..7a7cf49ecea0 100644
--- a/Zend/tests/constants/bug51791.phpt
+++ b/Zend/tests/constants/bug51791.phpt
@@ -9,9 +9,9 @@ class A {
try {
constant('A::B1');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined constant A::B1
+Error: Undefined constant A::B1
diff --git a/Zend/tests/constants/dynamic_class_const_fetch.phpt b/Zend/tests/constants/dynamic_class_const_fetch.phpt
index 1924536b964e..ae97fdfeaf93 100644
--- a/Zend/tests/constants/dynamic_class_const_fetch.phpt
+++ b/Zend/tests/constants/dynamic_class_const_fetch.phpt
@@ -11,7 +11,7 @@ function test($code) {
try {
var_dump(eval($code));
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -46,19 +46,19 @@ string(3) "bar"
string(3) "bar"
Warning: Undefined variable $barr in %s : eval()'d code on line %d
-Cannot use value of type null as class constant name
+TypeError: Cannot use value of type null as class constant name
Warning: Undefined variable $barr in %s : eval()'d code on line %d
-Cannot use value of type null as class constant name
+TypeError: Cannot use value of type null as class constant name
string(3) "bar"
string(3) "bar"
string(3) "Foo"
string(3) "Foo"
-Cannot use value of type int as class constant name
-Cannot use value of type int as class constant name
-Cannot use value of type int as class constant name
-Cannot use value of type int as class constant name
-Cannot use value of type array as class constant name
-Cannot use value of type array as class constant name
-Cannot use value of type array as class constant name
-Cannot use value of type array as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type int as class constant name
+TypeError: Cannot use value of type array as class constant name
+TypeError: Cannot use value of type array as class constant name
+TypeError: Cannot use value of type array as class constant name
+TypeError: Cannot use value of type array as class constant name
diff --git a/Zend/tests/constants/dynamic_class_const_fetch_order.phpt b/Zend/tests/constants/dynamic_class_const_fetch_order.phpt
index 4003c7db928c..5f2ce5340390 100644
--- a/Zend/tests/constants/dynamic_class_const_fetch_order.phpt
+++ b/Zend/tests/constants/dynamic_class_const_fetch_order.phpt
@@ -21,7 +21,7 @@ function test($c) {
try {
echo $c(), "\n";
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -32,6 +32,6 @@ test(fn() => Foo::{bar()}::{foo()});
--EXPECT--
foo()
bar()
-Undefined constant Foo::BAR
+Error: Undefined constant Foo::BAR
bar()
-Undefined constant Foo::BAR
+Error: Undefined constant Foo::BAR
diff --git a/Zend/tests/constants/gh10709.phpt b/Zend/tests/constants/gh10709.phpt
index f394e1a7882d..02268032a837 100644
--- a/Zend/tests/constants/gh10709.phpt
+++ b/Zend/tests/constants/gh10709.phpt
@@ -13,7 +13,7 @@ spl_autoload_register(function ($class) {
try {
new B();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/constants/gh10709_2.phpt b/Zend/tests/constants/gh10709_2.phpt
index 723fa29cc94b..3caa800035ab 100644
--- a/Zend/tests/constants/gh10709_2.phpt
+++ b/Zend/tests/constants/gh10709_2.phpt
@@ -15,7 +15,7 @@ spl_autoload_register(function ($class) {
try {
var_dump(new B());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
index 88c20f10cf62..8aa7ccfad0cd 100644
--- a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
+++ b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
@@ -5,10 +5,10 @@ Constant Expressions with unsupported operands 002
try {
require("constant_expressions_exceptions.inc");
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
?>
DONE
--EXPECTF--
-Exception: Unsupported operand types: array - array in %s on line %d
+TypeError: Unsupported operand types: array - array in %s on line %d
DONE
diff --git a/Zend/tests/constexpr/gh7771_3.phpt b/Zend/tests/constexpr/gh7771_3.phpt
index e44a01a8aec7..582058310255 100644
--- a/Zend/tests/constexpr/gh7771_3.phpt
+++ b/Zend/tests/constexpr/gh7771_3.phpt
@@ -13,4 +13,3 @@ var_dump(D::HW);
?>
--EXPECTF--
Fatal error: Constant expression contains invalid operations in %sgh7771_3.php(7) : eval()'d code on line 1
-
diff --git a/Zend/tests/constexpr/new.phpt b/Zend/tests/constexpr/new.phpt
index 79bbc41f69b5..468d762c8d97 100644
--- a/Zend/tests/constexpr/new.phpt
+++ b/Zend/tests/constexpr/new.phpt
@@ -6,7 +6,7 @@ new in constant expressions
try {
eval('static $a = new DoesNotExist;');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
static $b = new stdClass;
@@ -15,7 +15,7 @@ var_dump($b);
try {
eval('static $c = new stdClass([] + 0);');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test {
@@ -25,7 +25,7 @@ class Test {
try {
eval('static $d = new Test(new stdClass, [] + 0);');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
static $e = new Test(new stdClass, 42);
@@ -41,16 +41,16 @@ class Test2 {
try {
eval('static $f = new Test2();');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Class "DoesNotExist" not found
+Error: Class "DoesNotExist" not found
object(stdClass)#2 (0) {
}
-Unsupported operand types: array + int
-Unsupported operand types: array + int
+TypeError: Unsupported operand types: array + int
+TypeError: Unsupported operand types: array + int
object(Test)#4 (2) {
["a"]=>
object(stdClass)#1 (0) {
@@ -59,4 +59,4 @@ object(Test)#4 (2) {
int(42)
}
Side-effect
-Failed to construct
+Exception: Failed to construct
diff --git a/Zend/tests/constexpr/new_named_params.phpt b/Zend/tests/constexpr/new_named_params.phpt
index 6b57088f60fe..79ee83983c6b 100644
--- a/Zend/tests/constexpr/new_named_params.phpt
+++ b/Zend/tests/constexpr/new_named_params.phpt
@@ -19,7 +19,7 @@ var_dump($c);
try {
eval('static $d = new Vec(x: 0.0, x: 1.0);');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -48,4 +48,4 @@ object(Vec)#3 (3) {
["z"]=>
float(1)
}
-Named parameter $x overwrites previous argument
+Error: Named parameter $x overwrites previous argument
diff --git a/Zend/tests/constexpr/new_self_parent.phpt b/Zend/tests/constexpr/new_self_parent.phpt
index b134f77a498e..65eb1a5c1bbb 100644
--- a/Zend/tests/constexpr/new_self_parent.phpt
+++ b/Zend/tests/constexpr/new_self_parent.phpt
@@ -20,13 +20,13 @@ B::method();
try {
invalid();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
B::invalid();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -35,5 +35,5 @@ object(B)#1 (0) {
}
object(A)#2 (0) {
}
-Cannot access "self" when no class scope is active
-Cannot access "parent" when current class scope has no parent
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "parent" when current class scope has no parent
diff --git a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
index 206f99fd4094..890dd38632c1 100644
--- a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
+++ b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
@@ -13,9 +13,9 @@ $point = new Point(1, 2, 3);
try {
$point->x = "foo";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign string to property Point::$x of type int
+TypeError: Cannot assign string to property Point::$x of type int
diff --git a/Zend/tests/div_002.phpt b/Zend/tests/div_002.phpt
index 22ed3f139338..3dcfda24301b 100644
--- a/Zend/tests/div_002.phpt
+++ b/Zend/tests/div_002.phpt
@@ -9,7 +9,7 @@ $b = array(1);
try {
var_dump($a / $b);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $a / $b;
@@ -18,7 +18,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array / array
+TypeError: Unsupported operand types: array / array
Fatal error: Uncaught TypeError: Unsupported operand types: array / array in %s:%d
Stack trace:
diff --git a/Zend/tests/div_by_zero_compound_refcounted.phpt b/Zend/tests/div_by_zero_compound_refcounted.phpt
index 7f0f59622b44..bdac57623ef3 100644
--- a/Zend/tests/div_by_zero_compound_refcounted.phpt
+++ b/Zend/tests/div_by_zero_compound_refcounted.phpt
@@ -7,10 +7,10 @@ $h .= "2";
try {
$h /= 0;
} catch (DivisionByZeroError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($h);
?>
--EXPECT--
-Division by zero
+DivisionByZeroError: Division by zero
string(2) "12"
diff --git a/Zend/tests/div_by_zero_compound_with_conversion.phpt b/Zend/tests/div_by_zero_compound_with_conversion.phpt
index ba391328169f..bbb6b15c18c8 100644
--- a/Zend/tests/div_by_zero_compound_with_conversion.phpt
+++ b/Zend/tests/div_by_zero_compound_with_conversion.phpt
@@ -6,9 +6,9 @@ $x = 42;
try {
$$x /= 0;
} catch (DivisionByZeroError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $42 in %s on line %d
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/Zend/tests/dynamic_call/bug48770_2.phpt b/Zend/tests/dynamic_call/bug48770_2.phpt
index 14fe28cca23e..59c78afde767 100644
--- a/Zend/tests/dynamic_call/bug48770_2.phpt
+++ b/Zend/tests/dynamic_call/bug48770_2.phpt
@@ -26,13 +26,13 @@ class B extends A {
try {
call_user_func_array(array($this, 'parent::func22'), array($str));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
call_user_func_array(array($this, 'parent::inexistent'), array($str));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
private function func2($str) {
@@ -61,7 +61,7 @@ Deprecated: Callables of the form ["C", "parent::func3"] are deprecated in %s on
string(27) "B::func3: This should work!"
Deprecated: Callables of the form ["C", "parent::func22"] are deprecated in %s on line %d
-call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()
+TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()
Deprecated: Callables of the form ["C", "parent::inexistent"] are deprecated in %s on line %d
-call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent"
+TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent"
diff --git a/Zend/tests/dynamic_call/bug48770_3.phpt b/Zend/tests/dynamic_call/bug48770_3.phpt
index 98311eb8ece6..ac7fb0a2566a 100644
--- a/Zend/tests/dynamic_call/bug48770_3.phpt
+++ b/Zend/tests/dynamic_call/bug48770_3.phpt
@@ -23,7 +23,7 @@ class B extends A {
try {
call_user_func_array(array($this, 'self::inexistent'), array($str));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
private function func2($str) {
@@ -52,4 +52,4 @@ Deprecated: Callables of the form ["C", "self::func3"] are deprecated in %s on l
string(27) "B::func3: This should work!"
Deprecated: Callables of the form ["C", "self::inexistent"] are deprecated in %s on line %d
-call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"
+TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"
diff --git a/Zend/tests/dynamic_call/bug68475.phpt b/Zend/tests/dynamic_call/bug68475.phpt
index fef8173fc643..42e194e6ef55 100644
--- a/Zend/tests/dynamic_call/bug68475.phpt
+++ b/Zend/tests/dynamic_call/bug68475.phpt
@@ -37,7 +37,7 @@ $callback = 'TestClass::undefinedMethod';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Reference undefined class.
@@ -45,7 +45,7 @@ $callback = 'UndefinedClass::testMethod';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -53,5 +53,5 @@ Static method called!
Static method called!
Static method called with args: arg1, arg2, arg3
Static method called with args: arg1, arg2, arg3
-Call to undefined method TestClass::undefinedMethod()
-Class "UndefinedClass" not found
+Error: Call to undefined method TestClass::undefinedMethod()
+Error: Class "UndefinedClass" not found
diff --git a/Zend/tests/dynamic_call/bug77877.phpt b/Zend/tests/dynamic_call/bug77877.phpt
index 6ed35213efb2..9c32424de1c2 100644
--- a/Zend/tests/dynamic_call/bug77877.phpt
+++ b/Zend/tests/dynamic_call/bug77877.phpt
@@ -10,14 +10,14 @@ class Foo {
try {
array_map([new Foo, 'bar'],[1]);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func([new Foo, 'bar']);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Using $this when not in object context
-Using $this when not in object context
+Error: Using $this when not in object context
+Error: Using $this when not in object context
diff --git a/Zend/tests/dynamic_call/dynamic_call_005.phpt b/Zend/tests/dynamic_call/dynamic_call_005.phpt
index 91d1cb914c12..e0411683ee04 100644
--- a/Zend/tests/dynamic_call/dynamic_call_005.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_005.phpt
@@ -10,27 +10,27 @@ function test_calls($func) {
array_map($func, [['i' => new stdClass]]);
var_dump($i);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func(['i' => new stdClass]);
var_dump($i);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func($func, ['i' => new stdClass]);
var_dump($i);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
test_calls('extract');
?>
--EXPECT--
-Cannot call extract() dynamically
-Cannot call extract() dynamically
-Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
diff --git a/Zend/tests/dynamic_call/dynamic_call_006.phpt b/Zend/tests/dynamic_call/dynamic_call_006.phpt
index e6ea71915854..cfb17729b75f 100644
--- a/Zend/tests/dynamic_call/dynamic_call_006.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_006.phpt
@@ -8,51 +8,51 @@ function test() {
$func = 'extract';
$func(['a' => 'b']);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'compact';
$func(['a']);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'get_defined_vars';
$func();
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'func_get_args';
$func();
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'func_get_arg';
$func(1);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'func_num_args';
$func();
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
test();
?>
--EXPECT--
-Cannot call extract() dynamically
-Cannot call compact() dynamically
-Cannot call get_defined_vars() dynamically
-Cannot call func_get_args() dynamically
-Cannot call func_get_arg() dynamically
-Cannot call func_num_args() dynamically
+Error: Cannot call extract() dynamically
+Error: Cannot call compact() dynamically
+Error: Cannot call get_defined_vars() dynamically
+Error: Cannot call func_get_args() dynamically
+Error: Cannot call func_get_arg() dynamically
+Error: Cannot call func_num_args() dynamically
diff --git a/Zend/tests/dynamic_call/dynamic_call_007.phpt b/Zend/tests/dynamic_call/dynamic_call_007.phpt
index f1312b95b47a..484a3322bf90 100644
--- a/Zend/tests/dynamic_call/dynamic_call_007.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_007.phpt
@@ -8,7 +8,7 @@ function test() {
try {
array_map('extract', [['i' => new stdClass]]);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$i += 1;
var_dump($i);
@@ -17,5 +17,5 @@ test();
?>
--EXPECT--
-Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
int(2)
diff --git a/Zend/tests/dynamic_call/dynamic_call_008.phpt b/Zend/tests/dynamic_call/dynamic_call_008.phpt
index 1916bcf91345..f2a0e6c4d578 100644
--- a/Zend/tests/dynamic_call/dynamic_call_008.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_008.phpt
@@ -7,11 +7,11 @@ function test() {
try {
((string) 'extract')(['a' => 42]);
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
test();
?>
--EXPECT--
-Cannot call extract() dynamically
+Error: Cannot call extract() dynamically
diff --git a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
index 1bba3ebf6be1..185ab33629b3 100644
--- a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
@@ -7,22 +7,22 @@ try {
$bar = "bar";
("foo" . $bar)();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$bar = ["bar"];
(["foo"] + $bar)();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(new stdClass)();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to undefined function foobar()
-Array callback must have exactly two elements
-Object of type stdClass is not callable
+Error: Call to undefined function foobar()
+Error: Array callback must have exactly two elements
+Error: Object of type stdClass is not callable
diff --git a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
index f73d29a131d6..0f521d3273ac 100644
--- a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
@@ -17,14 +17,14 @@ $x = new Foo;
try {
$x->test1();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x->test2();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Non-static method Foo::bar() cannot be called statically
-Non-static method Foo::bar() cannot be called statically
+Error: Non-static method Foo::bar() cannot be called statically
+Error: Non-static method Foo::bar() cannot be called statically
diff --git a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
index cca6fa38b6c3..e709485a578c 100644
--- a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
+++ b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
@@ -7,9 +7,9 @@ namespace Foo;
try {
('\bar')();
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to undefined function bar()
+Error: Call to undefined function bar()
diff --git a/Zend/tests/dynamic_prop_deprecation_002.phpt b/Zend/tests/dynamic_prop_deprecation_002.phpt
index bd0d3aa5a7df..980bbef7d8dd 100644
--- a/Zend/tests/dynamic_prop_deprecation_002.phpt
+++ b/Zend/tests/dynamic_prop_deprecation_002.phpt
@@ -10,9 +10,9 @@ $a = new class{};
try {
[&$a->y];
} catch (Throwable $ex) {
- echo "Exception: " .$ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
Err: Creation of dynamic property class@anonymous::$y is deprecated
-Exception: Cannot create dynamic property class@anonymous::$y
+Error: Cannot create dynamic property class@anonymous::$y
diff --git a/Zend/tests/enum/ast-dumper.phpt b/Zend/tests/enum/ast-dumper.phpt
index 7972fe64965e..f7ff1f8d7c36 100644
--- a/Zend/tests/enum/ast-dumper.phpt
+++ b/Zend/tests/enum/ast-dumper.phpt
@@ -23,12 +23,12 @@ try {
return false;
})());
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-assert((function () {
+AssertionError: assert((function () {
enum Foo {
case Bar;
}
diff --git a/Zend/tests/enum/backed-duplicate-int.phpt b/Zend/tests/enum/backed-duplicate-int.phpt
index fb64ff29322e..4eade51093a5 100644
--- a/Zend/tests/enum/backed-duplicate-int.phpt
+++ b/Zend/tests/enum/backed-duplicate-int.phpt
@@ -11,30 +11,30 @@ enum Foo: int {
try {
var_dump(Foo::Bar);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::Bar);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::from(42));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::tryFrom('bar'));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Duplicate value in enum Foo for cases Bar and Baz
-Duplicate value in enum Foo for cases Bar and Baz
-Duplicate value in enum Foo for cases Bar and Baz
-Foo::tryFrom(): Argument #1 ($value) must be of type int, string given
+Error: Duplicate value in enum Foo for cases Bar and Baz
+Error: Duplicate value in enum Foo for cases Bar and Baz
+Error: Duplicate value in enum Foo for cases Bar and Baz
+TypeError: Foo::tryFrom(): Argument #1 ($value) must be of type int, string given
diff --git a/Zend/tests/enum/backed-duplicate-string.phpt b/Zend/tests/enum/backed-duplicate-string.phpt
index 22224ada35a3..24d76debb794 100644
--- a/Zend/tests/enum/backed-duplicate-string.phpt
+++ b/Zend/tests/enum/backed-duplicate-string.phpt
@@ -13,30 +13,30 @@ enum Suit: string {
try {
var_dump(Suit::Hearts);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Suit::Hearts);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Suit::from(42));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Suit::tryFrom('bar'));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Duplicate value in enum Suit for cases Hearts and Spades
-Duplicate value in enum Suit for cases Hearts and Spades
-Duplicate value in enum Suit for cases Hearts and Spades
-Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
+Error: Duplicate value in enum Suit for cases Hearts and Spades
diff --git a/Zend/tests/enum/backed-from-invalid-int.phpt b/Zend/tests/enum/backed-from-invalid-int.phpt
index d40cae30e6c8..d6c48b9f74f4 100644
--- a/Zend/tests/enum/backed-from-invalid-int.phpt
+++ b/Zend/tests/enum/backed-from-invalid-int.phpt
@@ -11,9 +11,9 @@ enum Foo: int {
try {
var_dump(Foo::from(2));
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-2 is not a valid backing value for enum Foo
+ValueError: 2 is not a valid backing value for enum Foo
diff --git a/Zend/tests/enum/backed-from-invalid-string.phpt b/Zend/tests/enum/backed-from-invalid-string.phpt
index c6d784872ef0..4c27d75d2ac1 100644
--- a/Zend/tests/enum/backed-from-invalid-string.phpt
+++ b/Zend/tests/enum/backed-from-invalid-string.phpt
@@ -13,9 +13,9 @@ enum Suit: string {
try {
var_dump(Suit::from('A'));
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-"A" is not a valid backing value for enum Suit
+ValueError: "A" is not a valid backing value for enum Suit
diff --git a/Zend/tests/enum/backed-from-invalid-type.phpt b/Zend/tests/enum/backed-from-invalid-type.phpt
index b4e0e6d6164f..9928f262b15b 100644
--- a/Zend/tests/enum/backed-from-invalid-type.phpt
+++ b/Zend/tests/enum/backed-from-invalid-type.phpt
@@ -13,7 +13,7 @@ enum Suit: string {
try {
var_dump(Suit::from(42));
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
enum Foo: int {
@@ -24,11 +24,11 @@ enum Foo: int {
try {
var_dump(Foo::from('H'));
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-"42" is not a valid backing value for enum Suit
-Foo::from(): Argument #1 ($value) must be of type int, string given
+ValueError: "42" is not a valid backing value for enum Suit
+TypeError: Foo::from(): Argument #1 ($value) must be of type int, string given
diff --git a/Zend/tests/enum/backed-mismatch.phpt b/Zend/tests/enum/backed-mismatch.phpt
index 73602f7b15b4..d02953016b1d 100644
--- a/Zend/tests/enum/backed-mismatch.phpt
+++ b/Zend/tests/enum/backed-mismatch.phpt
@@ -10,25 +10,25 @@ enum Foo: int {
try {
var_dump(Foo::Bar);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::Bar);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::from(42));
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::from('bar'));
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/enum/enum-as-params.phpt b/Zend/tests/enum/enum-as-params.phpt
index 90a1f0b5d07f..a06804d04631 100644
--- a/Zend/tests/enum/enum-as-params.phpt
+++ b/Zend/tests/enum/enum-as-params.phpt
@@ -20,16 +20,16 @@ takesBaz(Baz::Qux);
try {
takesBaz(Foo::Bar);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
takesFoo(Baz::Qux);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d
-takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d
+TypeError: takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d
+TypeError: takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d
diff --git a/Zend/tests/enum/internal_enums.phpt b/Zend/tests/enum/internal_enums.phpt
index ae26e24cd7ea..d642b9e9764f 100644
--- a/Zend/tests/enum/internal_enums.phpt
+++ b/Zend/tests/enum/internal_enums.phpt
@@ -34,7 +34,7 @@ function test_int_enum(int|string $case) {
try {
var_dump(ZendTestIntEnum::from($case));
} catch (\Error $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(ZendTestIntEnum::tryFrom($case));
}
diff --git a/Zend/tests/enum/internal_enums_strict_types.phpt b/Zend/tests/enum/internal_enums_strict_types.phpt
index 3d5ea231a271..183c87b26cca 100644
--- a/Zend/tests/enum/internal_enums_strict_types.phpt
+++ b/Zend/tests/enum/internal_enums_strict_types.phpt
@@ -12,17 +12,17 @@ var_dump(ZendTestStringEnum::from("Test2"));
try {
var_dump(ZendTestStringEnum::from(42));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ZendTestStringEnum::tryFrom(43));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
enum(ZendTestStringEnum::Bar)
-ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given
-ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given
+TypeError: ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given
+TypeError: ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given
diff --git a/Zend/tests/enum/json_encode.phpt b/Zend/tests/enum/json_encode.phpt
index f1174db7ae8e..ef59b63ccf65 100644
--- a/Zend/tests/enum/json_encode.phpt
+++ b/Zend/tests/enum/json_encode.phpt
@@ -35,7 +35,7 @@ function test($value) {
var_dump(json_encode($value, JSON_THROW_ON_ERROR));
echo json_last_error_msg() . "\n";
} catch (Exception $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/enum/no-clone-internal.phpt b/Zend/tests/enum/no-clone-internal.phpt
index 84b7ee2634d2..58d9aba276a8 100644
--- a/Zend/tests/enum/no-clone-internal.phpt
+++ b/Zend/tests/enum/no-clone-internal.phpt
@@ -8,9 +8,9 @@ zend_test
try {
var_dump(clone ZendTestIntEnum::Foo);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Trying to clone an uncloneable object of class ZendTestIntEnum
+Error: Trying to clone an uncloneable object of class ZendTestIntEnum
diff --git a/Zend/tests/enum/no-clone.phpt b/Zend/tests/enum/no-clone.phpt
index 2fadbb26b720..806ab0ae49ee 100644
--- a/Zend/tests/enum/no-clone.phpt
+++ b/Zend/tests/enum/no-clone.phpt
@@ -10,9 +10,9 @@ enum Foo {
try {
var_dump(clone Foo::Bar);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Trying to clone an uncloneable object of class Foo
+Error: Trying to clone an uncloneable object of class Foo
diff --git a/Zend/tests/enum/no-dynamic-properties-internal.phpt b/Zend/tests/enum/no-dynamic-properties-internal.phpt
index 8d821a5f6292..8a3328e3ecd3 100644
--- a/Zend/tests/enum/no-dynamic-properties-internal.phpt
+++ b/Zend/tests/enum/no-dynamic-properties-internal.phpt
@@ -10,9 +10,9 @@ $bar = ZendTestUnitEnum::Bar;
try {
$bar->baz = 'Baz';
} catch (\Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot create dynamic property ZendTestUnitEnum::$baz
+Error: Cannot create dynamic property ZendTestUnitEnum::$baz
diff --git a/Zend/tests/enum/no-dynamic-properties.phpt b/Zend/tests/enum/no-dynamic-properties.phpt
index 83d0d441b458..88938c7eac8f 100644
--- a/Zend/tests/enum/no-dynamic-properties.phpt
+++ b/Zend/tests/enum/no-dynamic-properties.phpt
@@ -12,9 +12,9 @@ $bar = Foo::Bar;
try {
$bar->baz = 'Baz';
} catch (\Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot create dynamic property Foo::$baz
+Error: Cannot create dynamic property Foo::$baz
diff --git a/Zend/tests/enum/no-new-through-reflection.phpt b/Zend/tests/enum/no-new-through-reflection.phpt
index 9a92559cd3d6..7807e2cb388f 100644
--- a/Zend/tests/enum/no-new-through-reflection.phpt
+++ b/Zend/tests/enum/no-new-through-reflection.phpt
@@ -8,9 +8,9 @@ enum Foo {}
try {
(new \ReflectionClass(Foo::class))->newInstanceWithoutConstructor();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot instantiate enum Foo
+Error: Cannot instantiate enum Foo
diff --git a/Zend/tests/enum/no-new.phpt b/Zend/tests/enum/no-new.phpt
index 698e9548827f..2abf4c9d8f9d 100644
--- a/Zend/tests/enum/no-new.phpt
+++ b/Zend/tests/enum/no-new.phpt
@@ -8,9 +8,9 @@ enum Foo {}
try {
new Foo();
} catch (\Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot instantiate enum Foo
+Error: Cannot instantiate enum Foo
diff --git a/Zend/tests/enum/no-pass-properties-by-ref.phpt b/Zend/tests/enum/no-pass-properties-by-ref.phpt
index 21c3a41e9352..1d5d34f45c57 100644
--- a/Zend/tests/enum/no-pass-properties-by-ref.phpt
+++ b/Zend/tests/enum/no-pass-properties-by-ref.phpt
@@ -15,12 +15,12 @@ try {
$bar = Foo::Bar;
$value = setBarValueByRef($bar->value, 1);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(Foo::Bar->value);
?>
--EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
int(0)
diff --git a/Zend/tests/enum/no-return-properties-by-ref.phpt b/Zend/tests/enum/no-return-properties-by-ref.phpt
index ea68e7a585cc..117eb1a7a119 100644
--- a/Zend/tests/enum/no-return-properties-by-ref.phpt
+++ b/Zend/tests/enum/no-return-properties-by-ref.phpt
@@ -16,12 +16,12 @@ try {
$value = &getBarValueByRef();
$value = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(Foo::Bar->value);
?>
--EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
int(0)
diff --git a/Zend/tests/enum/no-unset-propertes.phpt b/Zend/tests/enum/no-unset-propertes.phpt
index 867c853afa76..49a19fbffadb 100644
--- a/Zend/tests/enum/no-unset-propertes.phpt
+++ b/Zend/tests/enum/no-unset-propertes.phpt
@@ -15,23 +15,23 @@ $foo = Foo::Bar;
try {
unset($foo->name);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$intFoo = IntFoo::Bar;
try {
unset($intFoo->name);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($intFoo->value);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot unset readonly property Foo::$name
-Cannot unset readonly property IntFoo::$name
-Cannot unset readonly property IntFoo::$value
+Error: Cannot unset readonly property Foo::$name
+Error: Cannot unset readonly property IntFoo::$name
+Error: Cannot unset readonly property IntFoo::$value
diff --git a/Zend/tests/enum/no-write-properties-cache-slot.phpt b/Zend/tests/enum/no-write-properties-cache-slot.phpt
index d59268b6912e..cb1c6bad5a9f 100644
--- a/Zend/tests/enum/no-write-properties-cache-slot.phpt
+++ b/Zend/tests/enum/no-write-properties-cache-slot.phpt
@@ -16,12 +16,12 @@ enum Test {
try {
Test::A->modify();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(Test::A->name);
?>
--EXPECT--
string(1) "A"
-Cannot modify readonly property Test::$name
+Error: Cannot modify readonly property Test::$name
string(1) "A"
diff --git a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
index b02f49932904..f8507117f5be 100644
--- a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
+++ b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
@@ -11,12 +11,12 @@ try {
$bar = Foo::Bar;
foreach ([1] as &$bar->value) {}
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(Foo::Bar->value);
?>
--EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
int(0)
diff --git a/Zend/tests/enum/no-write-properties-through-references.phpt b/Zend/tests/enum/no-write-properties-through-references.phpt
index 17bd57b82ea2..0ba34e6c04a3 100644
--- a/Zend/tests/enum/no-write-properties-through-references.phpt
+++ b/Zend/tests/enum/no-write-properties-through-references.phpt
@@ -12,12 +12,12 @@ try {
$value = &$bar->value;
$value = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(Foo::Bar->value);
?>
--EXPECT--
-Cannot indirectly modify readonly property Foo::$value
+Error: Cannot indirectly modify readonly property Foo::$value
int(0)
diff --git a/Zend/tests/enum/no-write-properties.phpt b/Zend/tests/enum/no-write-properties.phpt
index e0022cfffe76..6eb80460f254 100644
--- a/Zend/tests/enum/no-write-properties.phpt
+++ b/Zend/tests/enum/no-write-properties.phpt
@@ -15,35 +15,35 @@ $bar = Foo::Bar;
try {
$bar->name = 'Baz';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$bar->value = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$intBar = IntFoo::Bar;
try {
$intBar->name = 'Baz';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$intBar->value = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$intBar->value2 = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property Foo::$name
-Cannot create dynamic property Foo::$value
-Cannot modify readonly property IntFoo::$name
-Cannot modify readonly property IntFoo::$value
-Cannot create dynamic property IntFoo::$value2
+Error: Cannot modify readonly property Foo::$name
+Error: Cannot create dynamic property Foo::$value
+Error: Cannot modify readonly property IntFoo::$name
+Error: Cannot modify readonly property IntFoo::$value
+Error: Cannot create dynamic property IntFoo::$value2
diff --git a/Zend/tests/errmsg/bug43344_1.phpt b/Zend/tests/errmsg/bug43344_1.phpt
index d517373d9f17..a8413f04afd2 100644
--- a/Zend/tests/errmsg/bug43344_1.phpt
+++ b/Zend/tests/errmsg/bug43344_1.phpt
@@ -19,27 +19,27 @@ function f3($a=array(bar=>0)) {
try {
echo bar."\n";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo f1()."\n";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo f2()."\n";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo f3()."\n";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined constant "Foo\bar"
-Undefined constant "Foo\bar"
-Undefined constant "Foo\bar"
-Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
+Error: Undefined constant "Foo\bar"
diff --git a/Zend/tests/errmsg/errmsg_020.phpt b/Zend/tests/errmsg/errmsg_020.phpt
index 4a7c326d0531..ea9429561aac 100644
--- a/Zend/tests/errmsg/errmsg_020.phpt
+++ b/Zend/tests/errmsg/errmsg_020.phpt
@@ -8,9 +8,9 @@ disable_functions=phpinfo
try {
phpinfo();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to undefined function phpinfo()
+Error: Call to undefined function phpinfo()
diff --git a/Zend/tests/error_reporting/bug72162.phpt b/Zend/tests/error_reporting/bug72162.phpt
index 721b0fc30680..570e17522f21 100644
--- a/Zend/tests/error_reporting/bug72162.phpt
+++ b/Zend/tests/error_reporting/bug72162.phpt
@@ -8,8 +8,8 @@ $var11 = new StdClass();
try {
$var16 = error_reporting($var11);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given
+TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given
diff --git a/Zend/tests/eval_constant_resolution.phpt b/Zend/tests/eval_constant_resolution.phpt
index d302d50a2c05..44bbe4b24bcd 100644
--- a/Zend/tests/eval_constant_resolution.phpt
+++ b/Zend/tests/eval_constant_resolution.phpt
@@ -20,4 +20,4 @@ Outside eval
bool(true)
bool(true)
string(4) "test"
-bool(true)
\ No newline at end of file
+bool(true)
diff --git a/Zend/tests/exception_set_previous_leak.phpt b/Zend/tests/exception_set_previous_leak.phpt
index 7fb680f95168..6208b45503c4 100644
--- a/Zend/tests/exception_set_previous_leak.phpt
+++ b/Zend/tests/exception_set_previous_leak.phpt
@@ -12,9 +12,9 @@ try {
throw $e;
}
} catch (Exception $e2) {
- echo $e2->getMessage(), "\n";
+ echo $e2::class, ': ', $e2->getMessage(), "\n";
}
?>
--EXPECT--
-Test
+Exception: Test
diff --git a/Zend/tests/exception_stream_wrapper.phpt b/Zend/tests/exception_stream_wrapper.phpt
index 4de8274fe0c1..7f81fc7f9fb6 100644
--- a/Zend/tests/exception_stream_wrapper.phpt
+++ b/Zend/tests/exception_stream_wrapper.phpt
@@ -21,7 +21,7 @@ stream_wrapper_register('abc', 'Loader');
try {
require 'abc://';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -29,4 +29,4 @@ try {
stream_set_option
stream_stat
stream_read
-Message
+Exception: Message
diff --git a/Zend/tests/exceptions/bug26698.phpt b/Zend/tests/exceptions/bug26698.phpt
index 8155f2090595..cf5e149ab9a7 100644
--- a/Zend/tests/exceptions/bug26698.phpt
+++ b/Zend/tests/exceptions/bug26698.phpt
@@ -26,7 +26,7 @@ class Proxy
}
catch(Exception $e)
{
- echo 'Caught: '.$e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -39,7 +39,7 @@ class Proxy
}
catch(Exception $e)
{
- echo 'Caught: '.$e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -52,7 +52,7 @@ class Proxy
}
catch(Exception $e)
{
- echo 'Caught: '.$e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -64,6 +64,6 @@ $p->callTwo();
$p->callThree();
?>
--EXPECT--
-Caught: NONE
-Caught: NONE
-Caught: NONE
+Exception: NONE
+Exception: NONE
+Exception: NONE
diff --git a/Zend/tests/exceptions/bug31102.phpt b/Zend/tests/exceptions/bug31102.phpt
index 17beec6ba389..e82a2af8b564 100644
--- a/Zend/tests/exceptions/bug31102.phpt
+++ b/Zend/tests/exceptions/bug31102.phpt
@@ -31,16 +31,16 @@ while($test++ < 5)
}
catch (Exception $e)
{
- echo "Caught: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
===DONE===
--EXPECTF--
{closure:%s:%d}(Test1,1)
-Caught: Test1::__construct
+Exception: Test1::__construct
{closure:%s:%d}(Test2,2)
-Caught: {closure:%s:%d}
+Exception: {closure:%s:%d}
{closure:%s:%d}(Test3,3)
Fatal error: Uncaught Error: Class "Test3" not found in %s:%d
diff --git a/Zend/tests/exceptions/bug47771.phpt b/Zend/tests/exceptions/bug47771.phpt
index c4350b9d95d3..b1792b0f3c97 100644
--- a/Zend/tests/exceptions/bug47771.phpt
+++ b/Zend/tests/exceptions/bug47771.phpt
@@ -23,7 +23,7 @@ try {
$T =new Test(throw_exc());
} catch( Exception $e) {
- echo 'Exception: ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/Zend/tests/exceptions/bug48428.phpt b/Zend/tests/exceptions/bug48428.phpt
index 0cda84dea4ee..b40a30ccb5e0 100644
--- a/Zend/tests/exceptions/bug48428.phpt
+++ b/Zend/tests/exceptions/bug48428.phpt
@@ -6,8 +6,8 @@ try {
function x() { throw new Exception("ERROR"); }
x(x());
} catch(Exception $e) {
- echo($e -> getMessage());
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-ERROR
+Exception: ERROR
diff --git a/Zend/tests/exceptions/bug50383.phpt b/Zend/tests/exceptions/bug50383.phpt
index 2f72ea51f853..2d5b8ddeca5c 100644
--- a/Zend/tests/exceptions/bug50383.phpt
+++ b/Zend/tests/exceptions/bug50383.phpt
@@ -23,20 +23,20 @@ function thrower2() {
try {
thrower();
} catch(Exception $e) {
- print $e->getMessage();
+ echo $e::class, ': ', $e->getMessage();
print_r($e->getTrace());
}
try {
thrower2();
} catch (Exception $e) {
- print $e->getMessage();
+ echo $e::class, ': ', $e->getMessage();
print_r($e->getTrace());
}
?>
--EXPECTF--
-Missing static method 'ThrowException'
+Exception: Missing static method 'ThrowException'
Array
(
[0] => Array
@@ -69,7 +69,7 @@ Array
)
)
-Missing method 'foo'
+Exception: Missing method 'foo'
Array
(
[0] => Array
diff --git a/Zend/tests/exceptions/bug53511.phpt b/Zend/tests/exceptions/bug53511.phpt
index b07504506a94..caa9f7fc7696 100644
--- a/Zend/tests/exceptions/bug53511.phpt
+++ b/Zend/tests/exceptions/bug53511.phpt
@@ -13,7 +13,7 @@ function test() {
try {
throw new Exception("ops 2");
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/exceptions/bug54043.phpt b/Zend/tests/exceptions/bug54043.phpt
index c6e08b75f9ee..e8e487f36840 100644
--- a/Zend/tests/exceptions/bug54043.phpt
+++ b/Zend/tests/exceptions/bug54043.phpt
@@ -9,12 +9,12 @@ $timeZone = new DateTimeZone('UTC');
try {
$dateTime = new DateTime($time, $timeZone);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(error_get_last());
?>
--EXPECT--
-string(80) "Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character"
+DateMalformedStringException: Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character
NULL
diff --git a/Zend/tests/exceptions/bug60569.phpt b/Zend/tests/exceptions/bug60569.phpt
index ef3bea8edb78..20af436a72c7 100644
--- a/Zend/tests/exceptions/bug60569.phpt
+++ b/Zend/tests/exceptions/bug60569.phpt
@@ -6,9 +6,10 @@ try {
$msg = "Some error \x00 message";
throw new Exception($msg);
} catch(Exception $e) {
- var_dump($e->getMessage(), $msg);
+ echo $e::class, ': ', $e->getMessage(), "\n";
+ var_dump($msg);
}
?>
--EXPECTF--
-string(20) "Some error %0 message"
+Exception: Some error %0 message
string(20) "Some error %0 message"
diff --git a/Zend/tests/exceptions/exception_001.phpt b/Zend/tests/exceptions/exception_001.phpt
index aba29d4aa3ee..0f0cd52702e9 100644
--- a/Zend/tests/exceptions/exception_001.phpt
+++ b/Zend/tests/exceptions/exception_001.phpt
@@ -9,28 +9,28 @@ try {
try {
throw new Exception();
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
?>
--EXPECTF--
-string(0) ""
-string(0) ""
-string(0) ""
-string(0) ""
+Exception:
+Exception:
+Exception:
+Exception:
Fatal error: Uncaught Exception in %s:%d
Stack trace:
diff --git a/Zend/tests/exceptions/exception_013.phpt b/Zend/tests/exceptions/exception_013.phpt
index 93d85761764b..20358f5a3e1e 100644
--- a/Zend/tests/exceptions/exception_013.phpt
+++ b/Zend/tests/exceptions/exception_013.phpt
@@ -9,29 +9,27 @@ class C {
try {
var_dump(C::$a);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
try {
var_dump(C::$p);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
try {
unset(C::$a);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
var_dump(C::$a);
?>
--EXPECTF--
-Exception: Access to undeclared static property C::$a in %s on line %d
-
-Exception: Cannot access private property C::$p in %sexception_013.php on line 13
-
-Exception: Attempt to unset static property C::$a in %sexception_013.php on line 19
+Error: Access to undeclared static property C::$a in %s on line %d
+Error: Cannot access private property C::$p in %sexception_013.php on line 13
+Error: Attempt to unset static property C::$a in %sexception_013.php on line 19
Fatal error: Uncaught Error: Access to undeclared static property C::$a in %s:%d
Stack trace:
diff --git a/Zend/tests/exceptions/exception_014.phpt b/Zend/tests/exceptions/exception_014.phpt
index aaf411dae56c..fb9e26ae2135 100644
--- a/Zend/tests/exceptions/exception_014.phpt
+++ b/Zend/tests/exceptions/exception_014.phpt
@@ -10,13 +10,13 @@ $x = new C;
try {
var_dump($x->p);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
var_dump($x->p);
?>
--EXPECTF--
-Exception: Cannot access private property C::$p in %sexception_014.php on line %d
+Error: Cannot access private property C::$p in %sexception_014.php on line %d
Fatal error: Uncaught Error: Cannot access private property C::$p in %sexception_014.php:%d
Stack trace:
diff --git a/Zend/tests/exceptions/exception_015.phpt b/Zend/tests/exceptions/exception_015.phpt
index a2b27154f657..8ca146054e04 100644
--- a/Zend/tests/exceptions/exception_015.phpt
+++ b/Zend/tests/exceptions/exception_015.phpt
@@ -6,13 +6,13 @@ $s = "ABC";
try {
$s[] = "D";
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
$s[] = "D";
?>
--EXPECTF--
-Exception: [] operator not supported for strings in %sexception_015.php on line %d
+Error: [] operator not supported for strings in %sexception_015.php on line %d
Fatal error: Uncaught Error: [] operator not supported for strings in %sexception_015.php:%d
Stack trace:
diff --git a/Zend/tests/exceptions/exception_016.phpt b/Zend/tests/exceptions/exception_016.phpt
index 5b52cf72cd7a..6b572c8eb37f 100644
--- a/Zend/tests/exceptions/exception_016.phpt
+++ b/Zend/tests/exceptions/exception_016.phpt
@@ -5,13 +5,13 @@ Exceptions on improper usage of $this
try {
$this->foo();
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
$this->foo();
?>
--EXPECTF--
-Exception: Using $this when not in object context in %sexception_016.php on line %d
+Error: Using $this when not in object context in %sexception_016.php on line %d
Fatal error: Uncaught Error: Using $this when not in object context in %sexception_016.php:%d
Stack trace:
diff --git a/Zend/tests/exceptions/exception_before_fatal.phpt b/Zend/tests/exceptions/exception_before_fatal.phpt
index edc63b2394cd..cd0c2d518a8a 100644
--- a/Zend/tests/exceptions/exception_before_fatal.phpt
+++ b/Zend/tests/exceptions/exception_before_fatal.phpt
@@ -11,38 +11,38 @@ set_error_handler("exception_error_handler");
try {
$foo->a();
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new $foo();
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
throw $foo;
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$foo();
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$foo::b();
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b = clone $foo;
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class b {
@@ -51,14 +51,14 @@ class b {
try {
b::$foo();
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
-string(23) "Undefined variable $foo"
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
+Exception: Undefined variable $foo
diff --git a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
index 5732e8cc5af7..dac064e5b364 100644
--- a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
+++ b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
@@ -15,9 +15,9 @@ $y = 5;
try {
$test->x =& $y;
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Foobar
+Exception: Foobar
diff --git a/Zend/tests/exceptions/exception_during_include_stat.phpt b/Zend/tests/exceptions/exception_during_include_stat.phpt
index 62747384e713..5b9fd071eea7 100644
--- a/Zend/tests/exceptions/exception_during_include_stat.phpt
+++ b/Zend/tests/exceptions/exception_during_include_stat.phpt
@@ -16,27 +16,27 @@ set_include_path('test://foo:test://bar');
try {
require_once 'doesnt_exist.php';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
require 'doesnt_exist.php';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
include_once 'doesnt_exist.php';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
include 'doesnt_exist.php';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-stat failed
-stat failed
-stat failed
-stat failed
+Exception: stat failed
+Exception: stat failed
+Exception: stat failed
+Exception: stat failed
diff --git a/Zend/tests/exceptions/exception_from_toString.phpt b/Zend/tests/exceptions/exception_from_toString.phpt
index dd4de341caf2..66b6e4bc6928 100644
--- a/Zend/tests/exceptions/exception_from_toString.phpt
+++ b/Zend/tests/exceptions/exception_from_toString.phpt
@@ -14,78 +14,78 @@ $num = 42;
$badStr = new BadStr;
try { $x = $str . $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $badStr . $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $str .= $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($str);
try { $x = $num . $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $badStr . $num; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $num .= $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($num);
try { $x = $badStr .= $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($badStr);
try { $x = $badStr .= $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($badStr);
try { $x = "x$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "{$badStr}x"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "$str$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "$badStr$str"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "x$badStr$str"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "x$str$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "{$str}x$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "{$badStr}x$str"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = (string) $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = include $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { echo $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
${""} = 42;
try { unset(${$badStr}); }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(${""});
unset(${""});
try { $x = ${$badStr}; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = isset(${$badStr}); }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
$obj = new stdClass;
try { $x = $obj->{$badStr} = $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($obj);
try { $str[0] = $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($str);
$obj = new DateInterval('P1D');
try { $x = $obj->{$badStr} = $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(!isset($obj->{""}));
try { strlen($badStr); } catch (Exception $e) { echo "Exception\n"; }
@@ -94,41 +94,41 @@ try { new ArrayObject([], 0, $badStr); } catch (Exception $e) { echo "Exception\
?>
--EXPECT--
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
string(1) "a"
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
int(42)
-Exception
+Exception: Exception
object(BadStr)#1 (0) {
}
-Exception
+Exception: Exception
object(BadStr)#1 (0) {
}
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
int(42)
-Exception
-Exception
-Exception
+Exception: Exception
+Exception: Exception
+Exception: Exception
object(stdClass)#2 (0) {
}
-Exception
+Exception: Exception
string(1) "a"
-Exception
+Exception: Exception
bool(true)
Exception
Exception
diff --git a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
index a9f9e77a59d9..e6d0246a9ebd 100644
--- a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
+++ b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
@@ -6,15 +6,15 @@ exception handler tests - 4
try {
set_exception_handler("fo");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
set_exception_handler(array("", ""));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name
-set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found
+TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name
+TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found
diff --git a/Zend/tests/exit/die_string_cast_exception.phpt b/Zend/tests/exit/die_string_cast_exception.phpt
index c20a873939df..9b84beacb1f4 100644
--- a/Zend/tests/exit/die_string_cast_exception.phpt
+++ b/Zend/tests/exit/die_string_cast_exception.phpt
@@ -6,9 +6,9 @@ Bug #79777: String cast exception during die should be handled gracefully
try {
die(new stdClass);
} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-exit(): Argument #1 ($status) must be of type string|int, stdClass given
+TypeError: exit(): Argument #1 ($status) must be of type string|int, stdClass given
diff --git a/Zend/tests/exit_finally_2.phpt b/Zend/tests/exit_finally_2.phpt
index 0a3f5dc7a1d1..d8a977edb680 100644
--- a/Zend/tests/exit_finally_2.phpt
+++ b/Zend/tests/exit_finally_2.phpt
@@ -15,7 +15,7 @@ try {
}
echo "Not executed\n";
} catch (Exception $e) {
- echo "Caught {$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/fe_fetch_dtor_exception.phpt b/Zend/tests/fe_fetch_dtor_exception.phpt
index 99378e739a8b..362c0e65cfbc 100644
--- a/Zend/tests/fe_fetch_dtor_exception.phpt
+++ b/Zend/tests/fe_fetch_dtor_exception.phpt
@@ -14,9 +14,9 @@ try {
var_dump($v);
}
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-foo
+Exception: foo
diff --git a/Zend/tests/fe_fetch_op2_live_range.phpt b/Zend/tests/fe_fetch_op2_live_range.phpt
index c601e43120e0..1c1df1f279c7 100644
--- a/Zend/tests/fe_fetch_op2_live_range.phpt
+++ b/Zend/tests/fe_fetch_op2_live_range.phpt
@@ -5,8 +5,8 @@ FE_FETCH op2 is a def and needs special live range handling
try {
foreach (["test"] as $k => func()[]) {}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to undefined function func()
+Error: Call to undefined function func()
diff --git a/Zend/tests/fibers/catch.phpt b/Zend/tests/fibers/catch.phpt
index 92c139ca1b4d..45ef21348c0a 100644
--- a/Zend/tests/fibers/catch.phpt
+++ b/Zend/tests/fibers/catch.phpt
@@ -7,7 +7,7 @@ $fiber = new Fiber(function () {
try {
Fiber::suspend('test');
} catch (Exception $exception) {
- var_dump($exception->getMessage());
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
});
@@ -19,4 +19,4 @@ $fiber->throw(new Exception('test'));
?>
--EXPECT--
string(4) "test"
-string(4) "test"
+Exception: test
diff --git a/Zend/tests/fibers/fiber-error-construct.phpt b/Zend/tests/fibers/fiber-error-construct.phpt
index 8af23ff86ebd..4b3ac43b7689 100644
--- a/Zend/tests/fibers/fiber-error-construct.phpt
+++ b/Zend/tests/fibers/fiber-error-construct.phpt
@@ -6,9 +6,9 @@ FiberError cannot be constructed in user code
try {
new FiberError;
} catch (Error $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-The "FiberError" class is reserved for internal use and cannot be manually instantiated
+Error: The "FiberError" class is reserved for internal use and cannot be manually instantiated
diff --git a/Zend/tests/fibers/get-return-after-throwing.phpt b/Zend/tests/fibers/get-return-after-throwing.phpt
index 620f74e3239c..4d401a898ea6 100644
--- a/Zend/tests/fibers/get-return-after-throwing.phpt
+++ b/Zend/tests/fibers/get-return-after-throwing.phpt
@@ -8,14 +8,14 @@ $fiber = new Fiber(fn() => throw new Exception('test'));
try {
$fiber->start();
} catch (Exception $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
$fiber->getReturn();
?>
--EXPECTF--
-test
+Exception: test
Fatal error: Uncaught FiberError: Cannot get fiber return value: The fiber threw an exception in %sget-return-after-throwing.php:%d
Stack trace:
diff --git a/Zend/tests/fibers/gh10249.phpt b/Zend/tests/fibers/gh10249.phpt
index efbef9c42a2e..ae8b1ddee966 100644
--- a/Zend/tests/fibers/gh10249.phpt
+++ b/Zend/tests/fibers/gh10249.phpt
@@ -9,9 +9,9 @@ $fiber = new Fiber($callback);
try {
$fiber->start();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Fiber stack size is too small, it needs to be at least %d bytes
+Exception: Fiber stack size is too small, it needs to be at least %d bytes
diff --git a/Zend/tests/fibers/gh20483.phpt b/Zend/tests/fibers/gh20483.phpt
index e06cf87258ea..c87263c171ab 100644
--- a/Zend/tests/fibers/gh20483.phpt
+++ b/Zend/tests/fibers/gh20483.phpt
@@ -9,8 +9,8 @@ $fiber = new Fiber($callback);
try {
$fiber->start();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Fiber stack size is too small, it needs to be at least %d bytes
+Exception: Fiber stack size is too small, it needs to be at least %d bytes
diff --git a/Zend/tests/fibers/negative_stack_size.phpt b/Zend/tests/fibers/negative_stack_size.phpt
index 591a8f28878d..c75686b89186 100644
--- a/Zend/tests/fibers/negative_stack_size.phpt
+++ b/Zend/tests/fibers/negative_stack_size.phpt
@@ -7,7 +7,7 @@ $fiber = new Fiber(function() {});
try {
$fiber->start();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
diff --git a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt
index dfde978ce06b..cdbc7e443a8a 100644
--- a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt
+++ b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt
@@ -16,12 +16,12 @@ try {
$fiber->start();
})();
} catch (FiberError $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "done\n";
?>
--EXPECT--
-Cannot suspend in a force-closed fiber
+FiberError: Cannot suspend in a force-closed fiber
done
diff --git a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
index f1b17caeb5d7..90e4f0c218df 100644
--- a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
+++ b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
@@ -20,7 +20,7 @@ $fiber = new Fiber(function (): void {
throw new \Exception("finally exception");
}
} catch (Exception $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
} finally {
echo "outer finally\n";
}
@@ -28,7 +28,7 @@ $fiber = new Fiber(function (): void {
try {
echo Fiber::suspend();
} catch (FiberError $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
});
@@ -42,7 +42,7 @@ echo "done\n";
--EXPECT--
fiber
inner finally
-finally exception
+Exception: finally exception
outer finally
-Cannot suspend in a force-closed fiber
+FiberError: Cannot suspend in a force-closed fiber
done
diff --git a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
index 2916c3dfff86..7eee426439b5 100644
--- a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
+++ b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
@@ -12,7 +12,7 @@ try {
function () { }
);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -22,12 +22,12 @@ try {
class {}
);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(!#[Attr(strrev(...))] function () {
+AssertionError: assert(!#[Attr(strrev(...))] function () {
})
-assert(!new #[Attr(strrev(...))] class {
+AssertionError: assert(!new #[Attr(strrev(...))] class {
})
diff --git a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt
index 97831a8d65f0..438fe6af8956 100644
--- a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt
+++ b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt
@@ -22,10 +22,10 @@ function foo(Closure $c = Foo::myMethod(...)) {
try {
foo();
} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Caught: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait
+ErrorException: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait
diff --git a/Zend/tests/first_class_callable/first_class_callable_015.phpt b/Zend/tests/first_class_callable/first_class_callable_015.phpt
index 72e1d413dd70..f83540f3f28c 100644
--- a/Zend/tests/first_class_callable/first_class_callable_015.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_015.phpt
@@ -15,10 +15,10 @@ do_weak_call($fn);
try {
do_strict_call($fn);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
int(42)
-test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
diff --git a/Zend/tests/first_class_callable/first_class_callable_assert.phpt b/Zend/tests/first_class_callable/first_class_callable_assert.phpt
index 2bf3d9fc69e2..2888da2447f3 100644
--- a/Zend/tests/first_class_callable/first_class_callable_assert.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_assert.phpt
@@ -10,16 +10,16 @@ $assert(1 == 1.0, "Message 1");
try {
$assert(1 == 2.0, "Message 2");
} catch (\AssertionError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && strlen(...));
} catch (\AssertionError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Message 2
-assert(false && strlen(...))
+AssertionError: Message 2
+AssertionError: assert(false && strlen(...))
diff --git a/Zend/tests/first_class_callable/first_class_callable_errors.phpt b/Zend/tests/first_class_callable/first_class_callable_errors.phpt
index dffcd779f361..337a13b1e39b 100644
--- a/Zend/tests/first_class_callable/first_class_callable_errors.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_errors.phpt
@@ -13,45 +13,45 @@ try {
$fn = 123;
$fn(...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
does_not_exist(...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
stdClass::doesNotExist(...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(new stdClass)->doesNotExist(...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
[new stdClass, 'doesNotExist'](...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::privateMethod(...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::instanceMethod(...);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Value of type int is not callable
-Call to undefined function does_not_exist()
-Call to undefined method stdClass::doesNotExist()
-Call to undefined method stdClass::doesNotExist()
-Call to undefined method stdClass::doesNotExist()
-Call to private method Test::privateMethod() from global scope
-Non-static method Test::instanceMethod() cannot be called statically
+Error: Value of type int is not callable
+Error: Call to undefined function does_not_exist()
+Error: Call to undefined method stdClass::doesNotExist()
+Error: Call to undefined method stdClass::doesNotExist()
+Error: Call to undefined method stdClass::doesNotExist()
+Error: Call to private method Test::privateMethod() from global scope
+Error: Non-static method Test::instanceMethod() cannot be called statically
diff --git a/Zend/tests/foreach/foreach_003.phpt b/Zend/tests/foreach/foreach_003.phpt
index 3ecb96de7951..c1678872921b 100644
--- a/Zend/tests/foreach/foreach_003.phpt
+++ b/Zend/tests/foreach/foreach_003.phpt
@@ -31,7 +31,7 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) {
// IS_CV
foreach ($obj as $key => $val) echo "$val\n";
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($obj);
@@ -39,33 +39,33 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) {
// IS_VAR
foreach (new IT(3, $trap) as $key => $val) echo "$val\n";
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
// IS_TMP_VAR
foreach ((object)new IT(2, $trap) as $key => $val) echo "$val\n";
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECT--
-rewind
-rewind
-rewind
-valid
-valid
-valid
-key
-key
-key
-current
-current
-current
+Exception: rewind
+Exception: rewind
+Exception: rewind
+Exception: valid
+Exception: valid
+Exception: valid
+Exception: key
+Exception: key
+Exception: key
+Exception: current
+Exception: current
+Exception: current
0
-next
+Exception: next
0
-next
+Exception: next
0
-next
+Exception: next
diff --git a/Zend/tests/frameless_undefined_var.phpt b/Zend/tests/frameless_undefined_var.phpt
index e9c5aac58236..0c40ff38f0c7 100644
--- a/Zend/tests/frameless_undefined_var.phpt
+++ b/Zend/tests/frameless_undefined_var.phpt
@@ -11,8 +11,8 @@ function test() {
try {
test();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined variable $foo
+Exception: Undefined variable $foo
diff --git a/Zend/tests/func_arg_fetch_optimization.phpt b/Zend/tests/func_arg_fetch_optimization.phpt
index ba01d8f7dee9..745064e20b07 100644
--- a/Zend/tests/func_arg_fetch_optimization.phpt
+++ b/Zend/tests/func_arg_fetch_optimization.phpt
@@ -8,8 +8,8 @@ function test($x) {
try {
test([]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot use [] for reading
+Error: Cannot use [] for reading
diff --git a/Zend/tests/func_get_arg_basic.phpt b/Zend/tests/func_get_arg_basic.phpt
index ec06a5c20f4d..8491f2bde81f 100644
--- a/Zend/tests/func_get_arg_basic.phpt
+++ b/Zend/tests/func_get_arg_basic.phpt
@@ -7,18 +7,18 @@ function test1() {
try {
var_dump(func_get_arg(-10));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(func_get_arg(0));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -26,12 +26,12 @@ function test2($a) {
try {
var_dump(func_get_arg(0));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -39,17 +39,17 @@ function test3($a, $b) {
try {
var_dump(func_get_arg(0));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(func_get_arg(2));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -59,7 +59,7 @@ test2(1);
try {
test2();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
test3(1,2);
@@ -67,7 +67,7 @@ call_user_func("test1");
try {
call_user_func("test3", 1);
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
call_user_func("test3", 1, 2);
@@ -76,12 +76,12 @@ class test {
try {
var_dump(func_get_arg(0));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}
@@ -90,32 +90,32 @@ test::test1(1);
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "Done\n";
?>
--EXPECTF--
-func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
+ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
int(10)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
int(1)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
int(1)
int(2)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
int(1)
int(2)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
int(1)
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
-func_get_arg() cannot be called from the global scope
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+Error: func_get_arg() cannot be called from the global scope
Done
diff --git a/Zend/tests/func_get_arg_invalid.phpt b/Zend/tests/func_get_arg_invalid.phpt
index 13e0443c07f6..4d4c996733c0 100644
--- a/Zend/tests/func_get_arg_invalid.phpt
+++ b/Zend/tests/func_get_arg_invalid.phpt
@@ -6,7 +6,7 @@ func_get_arg() invalid usage
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
function bar() {
@@ -20,10 +20,10 @@ function foo() {
try {
foo(1,2);
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-func_get_arg() cannot be called from the global scope
-func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
+Error: func_get_arg() cannot be called from the global scope
+ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt
index 33cfdb02ebcd..806333c2f9a6 100644
--- a/Zend/tests/func_get_args.phpt
+++ b/Zend/tests/func_get_args.phpt
@@ -6,9 +6,9 @@ Testing func_get_args() throws error when called from the global scope
try {
func_get_args();
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-func_get_args() cannot be called from the global scope
+Error: func_get_args() cannot be called from the global scope
diff --git a/Zend/tests/func_get_args_basic.phpt b/Zend/tests/func_get_args_basic.phpt
index 54ddf1b40c92..03c217839cbd 100644
--- a/Zend/tests/func_get_args_basic.phpt
+++ b/Zend/tests/func_get_args_basic.phpt
@@ -21,7 +21,7 @@ test2(1);
try {
test2();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
test3(1,2);
@@ -29,7 +29,7 @@ call_user_func("test1");
try {
call_user_func("test3", 1);
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
call_user_func("test3", 1, 2);
@@ -44,7 +44,7 @@ test::test1(1);
try {
var_dump(func_get_args());
} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -59,7 +59,7 @@ array(1) {
[0]=>
int(1)
}
-Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
array(2) {
[0]=>
int(1)
@@ -68,7 +68,7 @@ array(2) {
}
array(0) {
}
-Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
+ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
array(2) {
[0]=>
int(1)
@@ -79,4 +79,4 @@ array(1) {
[0]=>
int(1)
}
-func_get_args() cannot be called from the global scope
+Error: func_get_args() cannot be called from the global scope
diff --git a/Zend/tests/func_num_args_basic.phpt b/Zend/tests/func_num_args_basic.phpt
index 0e27b48d6501..afca294bc770 100644
--- a/Zend/tests/func_num_args_basic.phpt
+++ b/Zend/tests/func_num_args_basic.phpt
@@ -20,7 +20,7 @@ test2(1);
try {
test2();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
test3(1,2);
@@ -29,7 +29,7 @@ call_user_func("test1");
try {
call_user_func("test3", 1);
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
call_user_func("test3", 1, 2);
@@ -44,7 +44,7 @@ test::test1(1);
try {
func_num_args();
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "Done\n";
@@ -52,11 +52,11 @@ echo "Done\n";
--EXPECTF--
int(0)
int(1)
-Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
int(2)
int(0)
-Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
+ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
int(2)
int(1)
-func_num_args() must be called from a function context
+Error: func_num_args() must be called from a function context
Done
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
index d23a6a0c7057..1bf9e030bfcc 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
@@ -5,8 +5,8 @@ Call internal function with incorrect number of arguments
try {
substr("foo");
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-substr() expects at least 2 arguments, 1 given
+ArgumentCountError: substr() expects at least 2 arguments, 1 given
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
index 2b809cdb731a..2268ad854049 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
@@ -6,19 +6,15 @@ declare(strict_types=1);
try {
substr("foo");
} catch (ArgumentCountError $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
array_diff();
} catch (ArgumentCountError $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ArgumentCountError
-substr() expects at least 2 arguments, 1 given
-ArgumentCountError
-array_diff() expects at least 1 argument, 0 given
+ArgumentCountError: substr() expects at least 2 arguments, 1 given
+ArgumentCountError: array_diff() expects at least 1 argument, 0 given
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
index db9be6d85140..c29424c09bc8 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
@@ -6,16 +6,14 @@ try {
function foo($bar) { }
foo();
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
function bar($foo, $bar) { }
bar(1);
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
function bat(int $foo, string $bar) { }
@@ -23,23 +21,17 @@ function bat(int $foo, string $bar) { }
try {
bat(123);
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bat("123");
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-ArgumentCountError
-Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
-ArgumentCountError
-Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
-ArgumentCountError
-Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
-ArgumentCountError
-Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
+ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
index 2a67a9ce4c6b..2953dc57de83 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
@@ -7,16 +7,14 @@ try {
function foo($bar) { }
foo();
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
function bar($foo, $bar) { }
bar(1);
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
function bat(int $foo, string $bar) { }
@@ -24,32 +22,24 @@ function bat(int $foo, string $bar) { }
try {
bat(123);
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bat("123");
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bat(123, 456);
} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-ArgumentCountError
-Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
-ArgumentCountError
-Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
-ArgumentCountError
-Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
-TypeError
-bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d
-TypeError
-bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d
+ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
+ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
+ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+TypeError: bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d
+TypeError: bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d
diff --git a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
index 1a6dc97dd2e4..bd6bedca1dd5 100644
--- a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
+++ b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
@@ -15,7 +15,7 @@ try {
test('foo', 'bar', 'baz');
echo 'Not reached';
} catch (Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
$testFrame = $e->getTrace()[0];
var_dump($testFrame['function']);
var_dump(count($testFrame['args']));
@@ -37,7 +37,7 @@ try {
test2('foo', 'variadic1', 'variadic2', 'variadic3');
echo 'Not reached';
} catch (Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
$testFrame = $e->getTrace()[0];
var_dump($testFrame['function']);
var_dump(count($testFrame['args']));
@@ -53,14 +53,14 @@ try {
?>
--EXPECTF--
-Error
+Exception: Error
string(4) "test"
int(3)
string(3) "foo"
string(3) "bar"
string(3) "baz"
Success
-Error 2
+Exception: Error 2
string(5) "test2"
int(4)
string(3) "foo"
diff --git a/Zend/tests/function_arguments/variadic_argument_type_error.phpt b/Zend/tests/function_arguments/variadic_argument_type_error.phpt
index 9041aadcadfd..a7b06d363a77 100644
--- a/Zend/tests/function_arguments/variadic_argument_type_error.phpt
+++ b/Zend/tests/function_arguments/variadic_argument_type_error.phpt
@@ -8,16 +8,16 @@ function foo($foo, int ...$bar) {}
try {
foo(1, []);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
foo(1, 1, 1, []);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECTF--
-foo(): Argument #2 must be of type int, array given, called in %s on line %d
-foo(): Argument #4 must be of type int, array given, called in %s on line %d
+TypeError: foo(): Argument #2 must be of type int, array given, called in %s on line %d
+TypeError: foo(): Argument #4 must be of type int, array given, called in %s on line %d
diff --git a/Zend/tests/gc/bug54305.phpt b/Zend/tests/gc/bug54305.phpt
index 61e351306f78..1cbb5fc2ef25 100644
--- a/Zend/tests/gc/bug54305.phpt
+++ b/Zend/tests/gc/bug54305.phpt
@@ -12,8 +12,8 @@ $methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
try {
echo $methodWithArgs++;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot increment ReflectionMethod
+TypeError: Cannot increment ReflectionMethod
diff --git a/Zend/tests/gc/bug80072.phpt b/Zend/tests/gc/bug80072.phpt
index d7bf1956cf60..bbf1543ad5ed 100644
--- a/Zend/tests/gc/bug80072.phpt
+++ b/Zend/tests/gc/bug80072.phpt
@@ -7,11 +7,11 @@ try {
$s = 'O:8:"stdClass":1:{s:1:"x";r:1;}';
unserialize($s) % gc_collect_cycles();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$a[]=&$a == $a=&$b > gc_collect_cycles();
?>
--EXPECT--
-Unsupported operand types: stdClass % int
+TypeError: Unsupported operand types: stdClass % int
diff --git a/Zend/tests/generators/bug79927.phpt b/Zend/tests/generators/bug79927.phpt
index df8f245ddfde..dbebd77d70fc 100644
--- a/Zend/tests/generators/bug79927.phpt
+++ b/Zend/tests/generators/bug79927.phpt
@@ -12,7 +12,7 @@ $generator->next();
try {
$generator->rewind();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo $generator->current(), "\n";
@@ -26,6 +26,6 @@ echo $generator2->current(), "\n";
?>
--EXPECT--
-Cannot rewind a generator that was already run
+Exception: Cannot rewind a generator that was already run
3
4
diff --git a/Zend/tests/generators/clone.phpt b/Zend/tests/generators/clone.phpt
index 748b826365cc..dbe252e92274 100644
--- a/Zend/tests/generators/clone.phpt
+++ b/Zend/tests/generators/clone.phpt
@@ -12,7 +12,7 @@ try {
$gen = gen();
clone $gen;
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/generators/dynamic_properties.phpt b/Zend/tests/generators/dynamic_properties.phpt
index 08ceb7f581c6..2e40239b0acc 100644
--- a/Zend/tests/generators/dynamic_properties.phpt
+++ b/Zend/tests/generators/dynamic_properties.phpt
@@ -11,9 +11,9 @@ $gen = gen();
try {
$gen->prop = new stdClass;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot create dynamic property Generator::$prop
+Error: Cannot create dynamic property Generator::$prop
diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt
index 03ca1eed6032..060c41899761 100644
--- a/Zend/tests/generators/errors/count_error.phpt
+++ b/Zend/tests/generators/errors/count_error.phpt
@@ -10,9 +10,9 @@ $gen = gen();
try {
count($gen);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-count(): Argument #1 ($value) must be of type Countable|array, Generator given
+TypeError: count(): Argument #1 ($value) must be of type Countable|array, Generator given
diff --git a/Zend/tests/generators/errors/resume_running_generator_error.phpt b/Zend/tests/generators/errors/resume_running_generator_error.phpt
index 53e8611cf36c..46db7548266e 100644
--- a/Zend/tests/generators/errors/resume_running_generator_error.phpt
+++ b/Zend/tests/generators/errors/resume_running_generator_error.phpt
@@ -8,7 +8,7 @@ function gen() {
try {
$gen->next();
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$gen->next();
}
@@ -19,7 +19,7 @@ $gen->next();
?>
--EXPECTF--
-Exception: Cannot resume an already running generator
+Error: Cannot resume an already running generator
Fatal error: Uncaught Error: Cannot resume an already running generator in %s:%d
Stack trace:
diff --git a/Zend/tests/generators/errors/resume_running_generator_error_002.phpt b/Zend/tests/generators/errors/resume_running_generator_error_002.phpt
index e71e32a886dc..0b58864cf42e 100644
--- a/Zend/tests/generators/errors/resume_running_generator_error_002.phpt
+++ b/Zend/tests/generators/errors/resume_running_generator_error_002.phpt
@@ -10,8 +10,8 @@ $gen = gen();
try {
$gen->send($gen);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot resume an already running generator
+Error: Cannot resume an already running generator
diff --git a/Zend/tests/generators/generator_throwing_during_function_call.phpt b/Zend/tests/generators/generator_throwing_during_function_call.phpt
index bd0d2448b7d8..0ac335acf8f6 100644
--- a/Zend/tests/generators/generator_throwing_during_function_call.phpt
+++ b/Zend/tests/generators/generator_throwing_during_function_call.phpt
@@ -20,7 +20,7 @@ var_dump($gen->current());
try {
$gen->next();
} catch (Exception $e) {
- echo 'Caught exception with message "', $e->getMessage(), '"', "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($gen->current());
@@ -28,5 +28,5 @@ var_dump($gen->current());
?>
--EXPECT--
string(3) "foo"
-Caught exception with message "test"
+Exception: test
NULL
diff --git a/Zend/tests/generators/generator_throwing_exception.phpt b/Zend/tests/generators/generator_throwing_exception.phpt
index f537c3fc7726..a984bb0e7031 100644
--- a/Zend/tests/generators/generator_throwing_exception.phpt
+++ b/Zend/tests/generators/generator_throwing_exception.phpt
@@ -16,7 +16,7 @@ var_dump($gen->current());
try {
$gen->next();
} catch (Exception $e) {
- echo 'Caught exception with message "', $e->getMessage(), '"', "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($gen->current());
@@ -24,5 +24,5 @@ var_dump($gen->current());
?>
--EXPECT--
string(3) "foo"
-Caught exception with message "test"
+Exception: test
NULL
diff --git a/Zend/tests/generators/generator_with_type_check_2.phpt b/Zend/tests/generators/generator_with_type_check_2.phpt
index 21e8ab8bedc0..5e8c928f8d94 100644
--- a/Zend/tests/generators/generator_with_type_check_2.phpt
+++ b/Zend/tests/generators/generator_with_type_check_2.phpt
@@ -6,7 +6,7 @@ function gen(array $a) { yield; }
try {
gen(42);
} catch (TypeError $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -14,9 +14,9 @@ try {
var_dump($val);
}
} catch (TypeError $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
-gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
+TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
+TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
diff --git a/Zend/tests/generators/get_return_and_finally.phpt b/Zend/tests/generators/get_return_and_finally.phpt
index 150e5b83c4db..902d2e857642 100644
--- a/Zend/tests/generators/get_return_and_finally.phpt
+++ b/Zend/tests/generators/get_return_and_finally.phpt
@@ -31,17 +31,17 @@ try {
// during auto-priming, so fails
var_dump($gen->getReturn());
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
// This fails, because the return value was discarded
var_dump($gen->getReturn());
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
int(42)
-gen2() throw
-Cannot get return value of a generator that hasn't returned
+Exception: gen2() throw
+Exception: Cannot get return value of a generator that hasn't returned
diff --git a/Zend/tests/generators/get_return_errors.phpt b/Zend/tests/generators/get_return_errors.phpt
index f8d50aa3ded2..59c0792ca168 100644
--- a/Zend/tests/generators/get_return_errors.phpt
+++ b/Zend/tests/generators/get_return_errors.phpt
@@ -14,7 +14,7 @@ try {
// Generator hasn't reached the "return" yet
$gen->getReturn();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function gen2() {
@@ -27,13 +27,13 @@ $gen = gen2();
try {
$gen->next();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
// Generator has been aborted as a result of an exception
$gen->getReturn();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function gen3() {
@@ -47,7 +47,7 @@ try {
// Generator throws during auto-priming of getReturn() call
$gen->getReturn();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function gen4() {
@@ -59,21 +59,21 @@ $gen = gen4();
try {
$gen->throw(new Exception("gen4() throw"));
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
// Generator has been aborted as a result of an exception
// that was injected using throw()
$gen->getReturn();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot get return value of a generator that hasn't returned
-gen2() throw
-Cannot get return value of a generator that hasn't returned
-gen3() throw
-gen4() throw
-Cannot get return value of a generator that hasn't returned
+Exception: Cannot get return value of a generator that hasn't returned
+Exception: gen2() throw
+Exception: Cannot get return value of a generator that hasn't returned
+Exception: gen3() throw
+Exception: gen4() throw
+Exception: Cannot get return value of a generator that hasn't returned
diff --git a/Zend/tests/generators/gh11028_1.phpt b/Zend/tests/generators/gh11028_1.phpt
index e1e7aa5019e5..98227ed07e15 100644
--- a/Zend/tests/generators/gh11028_1.phpt
+++ b/Zend/tests/generators/gh11028_1.phpt
@@ -15,7 +15,7 @@ function test($msg, $x) {
try {
var_dump([...generator($x)]);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -26,10 +26,10 @@ test("object", new stdClass);
?>
--EXPECT--
yield null
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
yield false
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
yield true
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
yield object
-Keys must be of type int|string during array unpacking
+Error: Keys must be of type int|string during array unpacking
diff --git a/Zend/tests/generators/gh11028_3.phpt b/Zend/tests/generators/gh11028_3.phpt
index 7ea1aac6f6cf..de9158d75e11 100644
--- a/Zend/tests/generators/gh11028_3.phpt
+++ b/Zend/tests/generators/gh11028_3.phpt
@@ -14,8 +14,8 @@ function generator() {
try {
var_dump([...generator()]);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-exception
+Exception: exception
diff --git a/Zend/tests/generators/throw_into_yield_from_array.phpt b/Zend/tests/generators/throw_into_yield_from_array.phpt
index aa9fa822061b..509108f8a62a 100644
--- a/Zend/tests/generators/throw_into_yield_from_array.phpt
+++ b/Zend/tests/generators/throw_into_yield_from_array.phpt
@@ -20,7 +20,7 @@ function test($g) {
try {
$g->throw(new Exception("Exception!"));
} catch (Exception $e) {
- echo "{$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($g->current());
}
@@ -35,9 +35,9 @@ test(yf(yielditer($data)));
?>
--EXPECT--
int(1)
-Exception!
+Exception: Exception!
NULL
int(1)
-Exception!
+Exception: Exception!
NULL
diff --git a/Zend/tests/generators/yield_from_non_iterable.phpt b/Zend/tests/generators/yield_from_non_iterable.phpt
index 705bcaec3511..41f0fe9e6357 100644
--- a/Zend/tests/generators/yield_from_non_iterable.phpt
+++ b/Zend/tests/generators/yield_from_non_iterable.phpt
@@ -10,9 +10,9 @@ function gen() {
try {
gen()->current();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Can use "yield from" only with arrays and Traversables
+Error: Can use "yield from" only with arrays and Traversables
diff --git a/Zend/tests/generators/yield_from_valid_exception.phpt b/Zend/tests/generators/yield_from_valid_exception.phpt
index 0df541499cae..5bf524a67794 100644
--- a/Zend/tests/generators/yield_from_valid_exception.phpt
+++ b/Zend/tests/generators/yield_from_valid_exception.phpt
@@ -18,7 +18,7 @@ function gen() {
// the fact that the yield from result is used is relevant.
var_dump(yield from new FooBar);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -27,4 +27,4 @@ $x->current();
?>
--EXPECT--
-Exception from valid()
+Exception: Exception from valid()
diff --git a/Zend/tests/get_called_class_001.phpt b/Zend/tests/get_called_class_001.phpt
index caa6d154d9c5..21a463cc6d8c 100644
--- a/Zend/tests/get_called_class_001.phpt
+++ b/Zend/tests/get_called_class_001.phpt
@@ -6,9 +6,9 @@ Calling get_called_class() outside a class
try {
var_dump(get_called_class());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-get_called_class() must be called from within a class
+Error: get_called_class() must be called from within a class
diff --git a/Zend/tests/get_class_basic.phpt b/Zend/tests/get_class_basic.phpt
index f6dcbccb6916..d688f35a0008 100644
--- a/Zend/tests/get_class_basic.phpt
+++ b/Zend/tests/get_class_basic.phpt
@@ -12,7 +12,7 @@ class foo {
try {
var_dump(get_class(null));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -29,7 +29,7 @@ set_error_handler(function ($severity, $message, $file, $line) {
try {
$f1->bar();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
set_error_handler(null);
@@ -38,12 +38,12 @@ $f2->bar();
try {
var_dump(get_class());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(get_class("qwerty"));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(get_class($f1));
@@ -54,13 +54,13 @@ $f1->testNull();
echo "Done\n";
?>
--EXPECTF--
-Calling get_class() without arguments is deprecated
+Exception: Calling get_class() without arguments is deprecated
Deprecated: Calling get_class() without arguments is deprecated in %s on line %d
string(3) "foo"
-get_class() without arguments must be called from within a class
-get_class(): Argument #1 ($object) must be of type object, string given
+Error: get_class() without arguments must be called from within a class
+TypeError: get_class(): Argument #1 ($object) must be of type object, string given
string(3) "foo"
string(4) "foo2"
-get_class(): Argument #1 ($object) must be of type object, null given
+TypeError: get_class(): Argument #1 ($object) must be of type object, null given
Done
diff --git a/Zend/tests/get_class_vars/get_class_vars_001.phpt b/Zend/tests/get_class_vars/get_class_vars_001.phpt
index 84f502610eca..7d2d5fbc3f9a 100644
--- a/Zend/tests/get_class_vars/get_class_vars_001.phpt
+++ b/Zend/tests/get_class_vars/get_class_vars_001.phpt
@@ -22,7 +22,7 @@ var_dump(get_class_vars('B'));
try {
get_class_vars("Unknown");
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -37,4 +37,4 @@ array(2) {
["aa"]=>
int(4)
}
-get_class_vars(): Argument #1 ($class) must be a valid class name, Unknown given
+TypeError: get_class_vars(): Argument #1 ($class) must be a valid class name, Unknown given
diff --git a/Zend/tests/get_parent_class_basic.phpt b/Zend/tests/get_parent_class_basic.phpt
index b439fbf9fb3e..02e7a07d2765 100644
--- a/Zend/tests/get_parent_class_basic.phpt
+++ b/Zend/tests/get_parent_class_basic.phpt
@@ -28,7 +28,7 @@ set_error_handler(function ($severity, $message, $file, $line) {
try {
$foo->test();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
set_error_handler(null);
@@ -45,19 +45,19 @@ var_dump(get_parent_class("i"));
try {
get_parent_class("");
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
get_parent_class("[[[[");
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
get_parent_class(" ");
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(get_parent_class(new stdclass));
@@ -65,19 +65,19 @@ var_dump(get_parent_class(new stdclass));
try {
get_parent_class(array());
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
get_parent_class(1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECTF--
-Calling get_parent_class() without arguments is deprecated
+Exception: Calling get_parent_class() without arguments is deprecated
Deprecated: Calling get_parent_class() without arguments is deprecated in %s on line %d
bool(false)
@@ -90,10 +90,10 @@ bool(false)
string(3) "foo"
bool(false)
bool(false)
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
bool(false)
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
-get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
+TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
Done
diff --git a/Zend/tests/gh10169.phpt b/Zend/tests/gh10169.phpt
index 674122ac5935..32a8aca6a603 100644
--- a/Zend/tests/gh10169.phpt
+++ b/Zend/tests/gh10169.phpt
@@ -20,7 +20,7 @@ $a = new A();
try {
$a->prop = new B();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$a = new A();
@@ -28,10 +28,10 @@ $a->prop = '';
try {
$a->prop = new B();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Object was released while assigning to property A::$prop
-Object was released while assigning to property A::$prop
+Error: Object was released while assigning to property A::$prop
+Error: Object was released while assigning to property A::$prop
diff --git a/Zend/tests/gh10634.phpt b/Zend/tests/gh10634.phpt
index 41407bf307d7..cd36411b3792 100644
--- a/Zend/tests/gh10634.phpt
+++ b/Zend/tests/gh10634.phpt
@@ -6,7 +6,7 @@ function test_input($input) {
try {
eval($input);
} catch(Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -17,8 +17,8 @@ test_input("y ");
test_input("y&//");
?>
--EXPECT--
-string(36) "Unterminated comment starting line 1"
-string(36) "Unterminated comment starting line 1"
-string(36) "syntax error, unexpected end of file"
-string(36) "syntax error, unexpected end of file"
-string(36) "syntax error, unexpected end of file"
+ParseError: Unterminated comment starting line 1
+ParseError: Unterminated comment starting line 1
+ParseError: syntax error, unexpected end of file
+ParseError: syntax error, unexpected end of file
+ParseError: syntax error, unexpected end of file
diff --git a/Zend/tests/gh12102_1.phpt b/Zend/tests/gh12102_1.phpt
index 1d548d6b28f3..30608f54275a 100644
--- a/Zend/tests/gh12102_1.phpt
+++ b/Zend/tests/gh12102_1.phpt
@@ -8,7 +8,7 @@ function test() {
try {
byRef(func_get_args()[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -27,4 +27,4 @@ test('y');
?>
--EXPECT--
string(1) "y"
-Cannot use temporary expression in write context
+Error: Cannot use temporary expression in write context
diff --git a/Zend/tests/gh12102_3.phpt b/Zend/tests/gh12102_3.phpt
index 741bce5ab1ba..fd1b5fca9d24 100644
--- a/Zend/tests/gh12102_3.phpt
+++ b/Zend/tests/gh12102_3.phpt
@@ -8,7 +8,7 @@ function test() {
try {
byRef(C[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -29,4 +29,4 @@ test('y');
?>
--EXPECT--
string(3) "foo"
-Cannot use temporary expression in write context
+Error: Cannot use temporary expression in write context
diff --git a/Zend/tests/gh14969.phpt b/Zend/tests/gh14969.phpt
index dedbaa7456e0..a69a739f0e37 100644
--- a/Zend/tests/gh14969.phpt
+++ b/Zend/tests/gh14969.phpt
@@ -20,7 +20,7 @@ $d = new D();
try {
$d->prop = $c;
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($d);
@@ -29,18 +29,18 @@ $d->prop = 'foo';
try {
$d->prop = $c;
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($d);
?>
--EXPECTF--
-C::__toString
+Exception: C::__toString
object(D)#%d (0) {
["prop"]=>
uninitialized(string)
}
-C::__toString
+Exception: C::__toString
object(D)#2 (1) {
["prop"]=>
string(3) "foo"
diff --git a/Zend/tests/gh17162.phpt b/Zend/tests/gh17162.phpt
index bdf6ddbb36ba..d945c51e0037 100644
--- a/Zend/tests/gh17162.phpt
+++ b/Zend/tests/gh17162.phpt
@@ -14,8 +14,8 @@ $box = [new Test];
try {
getimagesize("dummy", $box);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Attempt to assign property "value" on null
+Error: Attempt to assign property "value" on null
diff --git a/Zend/tests/gh18736.phpt b/Zend/tests/gh18736.phpt
index f397ee39a310..9eefbc6fdf7c 100644
--- a/Zend/tests/gh18736.phpt
+++ b/Zend/tests/gh18736.phpt
@@ -16,9 +16,9 @@ try {
$x = &test();
var_dump($x);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-test(): Return value must be of type int, string returned
+TypeError: test(): Return value must be of type int, string returned
diff --git a/Zend/tests/gh19304.phpt b/Zend/tests/gh19304.phpt
index 47e20af64623..099138319ad8 100644
--- a/Zend/tests/gh19304.phpt
+++ b/Zend/tests/gh19304.phpt
@@ -10,9 +10,9 @@ $foo = new class {
try {
$foo->v = 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign int to property class@anonymous::$v of type self
+TypeError: Cannot assign int to property class@anonymous::$v of type self
diff --git a/Zend/tests/gh19306.phpt b/Zend/tests/gh19306.phpt
index e19735d94c84..9f98dd4cc6e2 100644
--- a/Zend/tests/gh19306.phpt
+++ b/Zend/tests/gh19306.phpt
@@ -26,7 +26,7 @@ echo "Fiber suspended\n";
try {
$a->next();
} catch (Throwable $t) {
- echo $t->getMessage(), "\n";
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
echo "Destroying fiber\n";
$fiber = null;
@@ -35,6 +35,6 @@ echo "Shutdown\n";
--EXPECT--
Fiber start
Fiber suspended
-Cannot resume an already running generator
+Error: Cannot resume an already running generator
Destroying fiber
Shutdown
diff --git a/Zend/tests/gh19326.phpt b/Zend/tests/gh19326.phpt
index 335fdd382ea6..07e93c96bb37 100644
--- a/Zend/tests/gh19326.phpt
+++ b/Zend/tests/gh19326.phpt
@@ -26,11 +26,11 @@ $fiber->start();
try {
$b->throw(new Exception('test'));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$fiber->resume();
?>
--EXPECT--
-Cannot resume an already running generator
+Error: Cannot resume an already running generator
diff --git a/Zend/tests/gh19719.phpt b/Zend/tests/gh19719.phpt
index 715e847846fe..4a09b5e57381 100644
--- a/Zend/tests/gh19719.phpt
+++ b/Zend/tests/gh19719.phpt
@@ -13,9 +13,9 @@ function takesInt(int $x) {}
try {
takesInt('42');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-takesInt(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
+TypeError: takesInt(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
diff --git a/Zend/tests/gh20564.phpt b/Zend/tests/gh20564.phpt
index 53311d952de7..6962c7f19bd9 100644
--- a/Zend/tests/gh20564.phpt
+++ b/Zend/tests/gh20564.phpt
@@ -16,9 +16,9 @@ class A {
try {
(new A)->test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-array_map(): Argument #1 ($callback) must be a valid callback or null, class "B" not found
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class "B" not found
diff --git a/Zend/tests/gh418106144.phpt b/Zend/tests/gh418106144.phpt
index 9357b0a179b1..e96bfe53cedf 100644
--- a/Zend/tests/gh418106144.phpt
+++ b/Zend/tests/gh418106144.phpt
@@ -12,9 +12,9 @@ function test($y=new Foo>''){
try {
test();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Foo::__toString(): Return value must be of type string, none returned
+TypeError: Foo::__toString(): Return value must be of type string, none returned
diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
index d0e9ddcba410..b3a6abe4da59 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
@@ -18,9 +18,9 @@ $foo = new Foo();
try {
$foo->foo()->baz ??= 1;
} catch (Exception $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Hello
+Exception: Hello
diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
index 4115d9eae26f..363e032cd738 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
@@ -16,9 +16,9 @@ $foo = new Foo();
try {
$foo->foo()->prop ??= 'foo';
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot assign string to property Foo::$prop of type int
+TypeError: Cannot assign string to property Foo::$prop of type int
diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
index f2808afbf84d..bc8e4cebbb25 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
@@ -14,9 +14,9 @@ function newFoo() {
try {
newFoo()->prop ??= 'foo';
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot assign string to property Foo::$prop of type int
+TypeError: Cannot assign string to property Foo::$prop of type int
diff --git a/Zend/tests/global_to_string_exception.phpt b/Zend/tests/global_to_string_exception.phpt
index 0c55a8c3d624..02e0b5410121 100644
--- a/Zend/tests/global_to_string_exception.phpt
+++ b/Zend/tests/global_to_string_exception.phpt
@@ -6,9 +6,9 @@ To string conversion failure in global
try {
global ${new stdClass};
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
diff --git a/Zend/tests/illegal_offset_unset_isset_empty.phpt b/Zend/tests/illegal_offset_unset_isset_empty.phpt
index ee837f0b6143..eef2dbc2e8fd 100644
--- a/Zend/tests/illegal_offset_unset_isset_empty.phpt
+++ b/Zend/tests/illegal_offset_unset_isset_empty.phpt
@@ -7,21 +7,21 @@ $ary = [];
try {
unset($ary[[]]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
isset($ary[[]]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
empty($ary[[]]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot unset offset of type array on array
-Cannot access offset of type array in isset or empty
-Cannot access offset of type array in isset or empty
+TypeError: Cannot unset offset of type array on array
+TypeError: Cannot access offset of type array in isset or empty
+TypeError: Cannot access offset of type array in isset or empty
diff --git a/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt b/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
index 21b4a9b01684..358b6a2882f4 100644
--- a/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
+++ b/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt
@@ -14,25 +14,25 @@ $nf = new NumericCastableNoOperations(58.3);
try {
var_dump($l - 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($f - 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($nl - 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($nf - 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
/* Decrement */
@@ -40,37 +40,37 @@ try {
$l--;
var_dump($l);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$f--;
var_dump($f);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$nl--;
var_dump($nl);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$nf--;
var_dump($nf);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Unsupported operand types: LongCastableNoOperations - int
-Unsupported operand types: FloatCastableNoOperations - int
+TypeError: Unsupported operand types: LongCastableNoOperations - int
+TypeError: Unsupported operand types: FloatCastableNoOperations - int
int(51)
float(57.3)
-Cannot decrement LongCastableNoOperations
-Cannot decrement FloatCastableNoOperations
+TypeError: Cannot decrement LongCastableNoOperations
+TypeError: Cannot decrement FloatCastableNoOperations
int(51)
float(57.3)
diff --git a/Zend/tests/in-de-crement/incdec_bool_exception.phpt b/Zend/tests/in-de-crement/incdec_bool_exception.phpt
index f819af1e2395..82f161daf700 100644
--- a/Zend/tests/in-de-crement/incdec_bool_exception.phpt
+++ b/Zend/tests/in-de-crement/incdec_bool_exception.phpt
@@ -12,17 +12,17 @@ foreach ($values as $value) {
try {
$value++;
} catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$value--;
} catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
?>
--EXPECT--
-Increment on type bool has no effect, this will change in the next major version of PHP
-Decrement on type bool has no effect, this will change in the next major version of PHP
-Increment on type bool has no effect, this will change in the next major version of PHP
-Decrement on type bool has no effect, this will change in the next major version of PHP
+Exception: Increment on type bool has no effect, this will change in the next major version of PHP
+Exception: Decrement on type bool has no effect, this will change in the next major version of PHP
+Exception: Increment on type bool has no effect, this will change in the next major version of PHP
+Exception: Decrement on type bool has no effect, this will change in the next major version of PHP
diff --git a/Zend/tests/in-de-crement/incdec_strings_exception.phpt b/Zend/tests/in-de-crement/incdec_strings_exception.phpt
index 5acbb1041222..b1ff56978b29 100644
--- a/Zend/tests/in-de-crement/incdec_strings_exception.phpt
+++ b/Zend/tests/in-de-crement/incdec_strings_exception.phpt
@@ -29,47 +29,47 @@ foreach ($values as $value) {
try {
$value++;
} catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($value);
try {
$value--;
} catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($value);
}
?>
--EXPECT--
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(0) ""
-Deprecated: Decrement on empty string is deprecated as non-numeric
+Exception: Deprecated: Decrement on empty string is deprecated as non-numeric
string(0) ""
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(1) " "
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(1) " "
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(4) "199A"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(4) "199A"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(4) "A199"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(4) "A199"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(4) "199Z"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(4) "199Z"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(4) "Z199"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(4) "Z199"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(11) "Hello world"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(11) "Hello world"
-Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
+Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead
string(4) "🐘"
-Deprecated: Decrement on non-numeric string has no effect and is deprecated
+Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated
string(4) "🐘"
diff --git a/Zend/tests/in-de-crement/incdec_types.phpt b/Zend/tests/in-de-crement/incdec_types.phpt
index 755b63957ef3..2578e4fc2638 100644
--- a/Zend/tests/in-de-crement/incdec_types.phpt
+++ b/Zend/tests/in-de-crement/incdec_types.phpt
@@ -10,12 +10,12 @@ foreach ($types as $type) {
try {
$type++;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$type--;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -40,12 +40,12 @@ foreach ($values as $value) {
}
?>
--EXPECTF--
-Cannot increment array
-Cannot decrement array
-Cannot increment stdClass
-Cannot decrement stdClass
-Cannot increment resource
-Cannot decrement resource
+TypeError: Cannot increment array
+TypeError: Cannot decrement array
+TypeError: Cannot increment stdClass
+TypeError: Cannot decrement stdClass
+TypeError: Cannot increment resource
+TypeError: Cannot decrement resource
Using increment:
Initial value:NULL
Result value:int(1)
diff --git a/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt b/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
index cf08055383ed..1ee98a599216 100644
--- a/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
+++ b/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt
@@ -14,25 +14,25 @@ $nf = new NumericCastableNoOperations(58.3);
try {
var_dump($l + 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($f + 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($nl + 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($nf + 1);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
/* Decrement */
@@ -40,37 +40,37 @@ try {
$l++;
var_dump($l);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$f++;
var_dump($f);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$nl++;
var_dump($nl);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$nf++;
var_dump($nf);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Unsupported operand types: LongCastableNoOperations + int
-Unsupported operand types: FloatCastableNoOperations + int
+TypeError: Unsupported operand types: LongCastableNoOperations + int
+TypeError: Unsupported operand types: FloatCastableNoOperations + int
int(53)
float(59.3)
-Cannot increment LongCastableNoOperations
-Cannot increment FloatCastableNoOperations
+TypeError: Cannot increment LongCastableNoOperations
+TypeError: Cannot increment FloatCastableNoOperations
int(53)
float(59.3)
diff --git a/Zend/tests/in-de-crement/object_cannot_incdec.phpt b/Zend/tests/in-de-crement/object_cannot_incdec.phpt
index 39a41d61dd3e..f601316bb9a9 100644
--- a/Zend/tests/in-de-crement/object_cannot_incdec.phpt
+++ b/Zend/tests/in-de-crement/object_cannot_incdec.phpt
@@ -8,38 +8,38 @@ $o = new Foo;
try {
$o++;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
try {
$o--;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
try {
++$o;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
try {
--$o;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
?>
--EXPECT--
-Cannot increment Foo
+TypeError: Cannot increment Foo
object(Foo)#1 (0) {
}
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
object(Foo)#1 (0) {
}
-Cannot increment Foo
+TypeError: Cannot increment Foo
object(Foo)#1 (0) {
}
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
object(Foo)#1 (0) {
}
diff --git a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
index b4c193a67182..ba7ca7396e60 100644
--- a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
+++ b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt
@@ -8,38 +8,38 @@ $o = new Foo;
try {
$y = $o++;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
try {
$y = $o--;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
try {
$y = ++$o;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
try {
$y = --$o;
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
var_dump($o);
}
?>
--EXPECT--
-Cannot increment Foo
+TypeError: Cannot increment Foo
object(Foo)#1 (0) {
}
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
object(Foo)#1 (0) {
}
-Cannot increment Foo
+TypeError: Cannot increment Foo
object(Foo)#1 (0) {
}
-Cannot decrement Foo
+TypeError: Cannot decrement Foo
object(Foo)#1 (0) {
}
diff --git a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
index 51b4c8f1fd72..183221b2b217 100644
--- a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
+++ b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
@@ -22,13 +22,13 @@ foreach (['pre', 'post'] as $prePost) {
try {
$foo->{$prePost . ucfirst($incDec)}();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
?>
--EXPECT--
-Cannot increment Foo
-Cannot decrement Foo
-Cannot increment Foo
-Cannot decrement Foo
+TypeError: Cannot increment Foo
+TypeError: Cannot decrement Foo
+TypeError: Cannot increment Foo
+TypeError: Cannot decrement Foo
diff --git a/Zend/tests/in-de-crement/overloaded_access.phpt b/Zend/tests/in-de-crement/overloaded_access.phpt
index 56a5c2b1d47a..feb15c60c6cf 100644
--- a/Zend/tests/in-de-crement/overloaded_access.phpt
+++ b/Zend/tests/in-de-crement/overloaded_access.phpt
@@ -22,15 +22,15 @@ $foo = new Foo;
try {
$foo[0]++;
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$foo = new Foo;
try {
$foo[0]--;
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot increment array
-Cannot decrement array
+TypeError: Cannot increment array
+TypeError: Cannot decrement array
diff --git a/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
index d435c9fb4029..eb473d9c70ec 100644
--- a/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
+++ b/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt
@@ -15,11 +15,11 @@ unset($c->a);
try {
(++$c->a);
} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($c->a);
?>
--EXPECT--
-Cannot increment stdClass
+TypeError: Cannot increment stdClass
object(stdClass)#2 (0) {
}
diff --git a/Zend/tests/include_stat_is_quiet.phpt b/Zend/tests/include_stat_is_quiet.phpt
index 39eb3053fbe4..57138ddd06c6 100644
--- a/Zend/tests/include_stat_is_quiet.phpt
+++ b/Zend/tests/include_stat_is_quiet.phpt
@@ -21,7 +21,7 @@ set_include_path('test://foo:test://bar');
try {
require_once 'doesnt_exist.php';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt
index 3fe0456175f0..a50c769b3da7 100644
--- a/Zend/tests/incompat_ctx_user.phpt
+++ b/Zend/tests/incompat_ctx_user.phpt
@@ -13,8 +13,8 @@ $b = new B;
try {
$b->bar();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Non-static method A::foo() cannot be called statically
+Error: Non-static method A::foo() cannot be called statically
diff --git a/Zend/tests/indexing_001.phpt b/Zend/tests/indexing_001.phpt
index 66b20da03a03..d98e793232af 100644
--- a/Zend/tests/indexing_001.phpt
+++ b/Zend/tests/indexing_001.phpt
@@ -10,7 +10,7 @@ foreach ($testvalues as $testvalue) {
try {
$testvalue['foo']=$array;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($testvalue);
}
@@ -22,7 +22,7 @@ foreach ($testvalues as $testvalue) {
try {
$testvalue['foo']=&$array;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($testvalue);
}
@@ -34,7 +34,7 @@ foreach ($testvalues as $testvalue) {
try {
$testvalue[]=$array;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump ($testvalue);
}
@@ -46,7 +46,7 @@ foreach ($testvalues as $testvalue) {
try {
$testvalue[]=&$array;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump ($testvalue);
}
@@ -61,11 +61,11 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
bool(true)
Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -76,11 +76,11 @@ array(1) {
int(1)
}
}
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(0) ""
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(1) " "
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
float(0.1)
array(1) {
["foo"]=>
@@ -98,11 +98,11 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
bool(true)
Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -113,7 +113,7 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
float(0.1)
array(1) {
["foo"]=>
@@ -130,11 +130,11 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
bool(true)
Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -145,7 +145,7 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
float(0.1)
array(1) {
[0]=>
@@ -163,11 +163,11 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(0)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(1)
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
bool(true)
Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -178,7 +178,7 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
float(0.1)
array(1) {
[0]=>
diff --git a/Zend/tests/indirect_function_call/indirect_call_array_003.phpt b/Zend/tests/indirect_function_call/indirect_call_array_003.phpt
index 603b3bfc299b..30d84109ce31 100644
--- a/Zend/tests/indirect_function_call/indirect_call_array_003.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_array_003.phpt
@@ -20,7 +20,7 @@ $arr = array('foo', 'abc');
try {
$arr();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo = new foo;
$arr = array($foo, 'abc');
@@ -31,7 +31,7 @@ $arr();
--EXPECTF--
From foo::__callStatic:
string(3) "abc"
-Exception: Using $this when not in object context
+Error: Using $this when not in object context
From foo::__call:
string(3) "abc"
object(foo)#%d (0) {
diff --git a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
index e8520efd12b0..ed3cb5c28b8a 100644
--- a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
@@ -24,7 +24,7 @@ try {
$arr();
}
catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr = array('foo', '123');
@@ -33,7 +33,7 @@ try {
$arr();
}
catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -46,7 +46,7 @@ try {
$arr();
}
catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -57,15 +57,15 @@ try {
$arr();
}
catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-foo
+Exception: foo
From foo::__callStatic:
-123
+Exception: 123
------
-foo
+Exception: foo
From foo::__call:
-123
+Exception: 123
diff --git a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
index 7704c1cd9a4d..348922169e5b 100644
--- a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
@@ -23,7 +23,7 @@ $callback = ['', 'method'];
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test Class::method syntax with empty class name
@@ -31,7 +31,7 @@ $callback = '::method';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test array syntax with empty class and method name
@@ -39,7 +39,7 @@ $callback = ['', ''];
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test Class::method syntax with empty class and method name
@@ -47,7 +47,7 @@ $callback = '::';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test string ending in single colon
@@ -55,7 +55,7 @@ $callback = 'Class:';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test string beginning in single colon
@@ -63,7 +63,7 @@ $callback = ':method';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test single colon
@@ -71,16 +71,16 @@ $callback = ':';
try {
$callback();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
string(0) ""
string(0) ""
-Class "" not found
-Class "" not found
-Class "" not found
-Class "" not found
-Call to undefined function Class:()
-Call to undefined function :method()
-Call to undefined function :()
+Error: Class "" not found
+Error: Class "" not found
+Error: Class "" not found
+Error: Class "" not found
+Error: Call to undefined function Class:()
+Error: Call to undefined function :method()
+Error: Call to undefined function :()
diff --git a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
index 39967fdb267d..b2aa97cc9784 100644
--- a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
+++ b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
@@ -12,9 +12,9 @@ class foo {
try {
$X = (new foo)->Inexistent(3);
} catch (Exception $e) {
- var_dump($e->getMessage()); // foobar
+ echo $e::class, ': ', $e->getMessage(), "\n"; // foobar
}
?>
--EXPECT--
-string(6) "foobar"
+Exception: foobar
diff --git a/Zend/tests/init_array_illegal_offset_type.phpt b/Zend/tests/init_array_illegal_offset_type.phpt
index ee41c0217ad7..d895ed053424 100644
--- a/Zend/tests/init_array_illegal_offset_type.phpt
+++ b/Zend/tests/init_array_illegal_offset_type.phpt
@@ -8,8 +8,8 @@ function test() {
try {
test();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access offset of type stdClass on array
+TypeError: Cannot access offset of type stdClass on array
diff --git a/Zend/tests/int_static_prop_name.phpt b/Zend/tests/int_static_prop_name.phpt
index e29e2514bb97..c7a366da66bd 100644
--- a/Zend/tests/int_static_prop_name.phpt
+++ b/Zend/tests/int_static_prop_name.phpt
@@ -17,19 +17,19 @@ var_dump(${(int) $n});
try {
var_dump(Foo::${42});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::${(int) 42});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::${(int) $n});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -37,6 +37,6 @@ try {
int(24)
int(24)
int(24)
-Access to undeclared static property Foo::$42
-Access to undeclared static property Foo::$42
-Access to undeclared static property Foo::$42
+Error: Access to undeclared static property Foo::$42
+Error: Access to undeclared static property Foo::$42
+Error: Access to undeclared static property Foo::$42
diff --git a/Zend/tests/invalid_parent_const_ref_leak.phpt b/Zend/tests/invalid_parent_const_ref_leak.phpt
index ed728f7d45e4..605c1524fb56 100644
--- a/Zend/tests/invalid_parent_const_ref_leak.phpt
+++ b/Zend/tests/invalid_parent_const_ref_leak.phpt
@@ -10,9 +10,9 @@ class A {
try {
A::B;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access "parent" when current class scope has no parent
+Error: Cannot access "parent" when current class scope has no parent
diff --git a/Zend/tests/isset/isset_array.phpt b/Zend/tests/isset/isset_array.phpt
index 48e908a36d56..92bac0c8e932 100644
--- a/Zend/tests/isset/isset_array.phpt
+++ b/Zend/tests/isset/isset_array.phpt
@@ -25,13 +25,13 @@ var_dump(isset($array[STDIN]));
try {
isset($array[[]]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
isset($array[new stdClass()]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -48,5 +48,5 @@ bool(false)
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
bool(false)
-Cannot access offset of type array in isset or empty
-Cannot access offset of type stdClass in isset or empty
+TypeError: Cannot access offset of type array in isset or empty
+TypeError: Cannot access offset of type stdClass in isset or empty
diff --git a/Zend/tests/iterable_or_null.phpt b/Zend/tests/iterable_or_null.phpt
index a44e858bce92..6b59a117de2b 100644
--- a/Zend/tests/iterable_or_null.phpt
+++ b/Zend/tests/iterable_or_null.phpt
@@ -8,19 +8,19 @@ zend_test
try {
var_dump(zend_iterable("string"));
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(zend_iterable(1));
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(zend_iterable(null));
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
@@ -35,13 +35,12 @@ zend_iterable($iterator, null);
try {
var_dump(zend_iterable([], "string"));
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, string given
-zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, int given
-zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, null given
-zend_iterable(): Argument #2 ($arg2) must be of type Traversable|array|null, string given
-
+TypeError: zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, string given
+TypeError: zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, int given
+TypeError: zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, null given
+TypeError: zend_iterable(): Argument #2 ($arg2) must be of type Traversable|array|null, string given
diff --git a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
index c46756718649..a9abb9e9b606 100644
--- a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
+++ b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
@@ -33,7 +33,7 @@ var_dump($object2);
try {
var_dump($object1->propB);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// The state of both objects is unchanged
@@ -52,7 +52,7 @@ lazy ghost object(MyClass)#%d (1) {
["propA"]=>
string(8) "object-2"
}
-initializer exception
+Exception: initializer exception
lazy ghost object(MyClass)#%d (1) {
["propA"]=>
string(8) "object-1"
diff --git a/Zend/tests/lazy_objects/typed_properties_001.phpt b/Zend/tests/lazy_objects/typed_properties_001.phpt
index 1f457531d87c..3f4c1d1b2734 100644
--- a/Zend/tests/lazy_objects/typed_properties_001.phpt
+++ b/Zend/tests/lazy_objects/typed_properties_001.phpt
@@ -21,13 +21,13 @@ $ref = "foobar";
try {
$test->$name =& $ref;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
?>
--EXPECTF--
-Cannot assign string to property Test::$prop of type int
+TypeError: Cannot assign string to property Test::$prop of type int
lazy proxy object(Test)#%d (1) {
["instance"]=>
object(Test)#%d (0) {
diff --git a/Zend/tests/live_range_phi_leak.phpt b/Zend/tests/live_range_phi_leak.phpt
index f07258405301..f31840d5150f 100644
--- a/Zend/tests/live_range_phi_leak.phpt
+++ b/Zend/tests/live_range_phi_leak.phpt
@@ -12,8 +12,8 @@ function test($k) {
try {
test(new stdClass);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Test
+Exception: Test
diff --git a/Zend/tests/magic_methods/bug26166.phpt b/Zend/tests/magic_methods/bug26166.phpt
index 3e5c6daa21d4..99f4a1e08e7b 100644
--- a/Zend/tests/magic_methods/bug26166.phpt
+++ b/Zend/tests/magic_methods/bug26166.phpt
@@ -41,7 +41,7 @@ $o = new NoneTest;
try {
echo $o;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "===THROW===\n";
@@ -57,13 +57,13 @@ $o = new ErrorTest;
try {
echo $o;
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Hello World!
===NONE===
-NoneTest::__toString(): Return value must be of type string, none returned
+TypeError: NoneTest::__toString(): Return value must be of type string, none returned
===THROW===
-This is an error!
+Exception: This is an error!
diff --git a/Zend/tests/magic_methods/bug29368_2.phpt b/Zend/tests/magic_methods/bug29368_2.phpt
index e13d6da88467..fda92130c504 100644
--- a/Zend/tests/magic_methods/bug29368_2.phpt
+++ b/Zend/tests/magic_methods/bug29368_2.phpt
@@ -12,10 +12,10 @@ class Bomb {
try {
$x = new ReflectionMethod(new Bomb(), "foo");
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "ok\n";
?>
--EXPECT--
-bomb!
+Exception: bomb!
ok
diff --git a/Zend/tests/magic_methods/bug45186.phpt b/Zend/tests/magic_methods/bug45186.phpt
index 9e0078d77002..f0796278c58a 100644
--- a/Zend/tests/magic_methods/bug45186.phpt
+++ b/Zend/tests/magic_methods/bug45186.phpt
@@ -34,7 +34,7 @@ call_user_func('BAR::www');
try {
call_user_func('self::y');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -58,4 +58,4 @@ string(1) "y"
ok
__callstatic:
string(3) "www"
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
diff --git a/Zend/tests/magic_methods/bug45186_2.phpt b/Zend/tests/magic_methods/bug45186_2.phpt
index e85528ce8b00..eec4b3ab3bcb 100644
--- a/Zend/tests/magic_methods/bug45186_2.phpt
+++ b/Zend/tests/magic_methods/bug45186_2.phpt
@@ -29,12 +29,12 @@ call_user_func(array('BAR','x'));
try {
call_user_func('BAR::www');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func('self::y');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -56,5 +56,5 @@ Deprecated: Use of "self" in callables is deprecated in %s on line %d
__call:
string(1) "y"
ok
-call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www"
-call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www"
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active
diff --git a/Zend/tests/magic_methods/bug76667.phpt b/Zend/tests/magic_methods/bug76667.phpt
index 03bd490a0409..b0124633db17 100644
--- a/Zend/tests/magic_methods/bug76667.phpt
+++ b/Zend/tests/magic_methods/bug76667.phpt
@@ -19,11 +19,11 @@ $x = new T;
try {
$x->x = 1;
} catch (\DivisionByZeroError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Warning: Undefined variable $undefined in %s on line %d
Warning: Attempt to read property "1" on null in %s on line %d
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/Zend/tests/match/043.phpt b/Zend/tests/match/043.phpt
index 03ff0cbf36d6..ab993b13bc43 100644
--- a/Zend/tests/match/043.phpt
+++ b/Zend/tests/match/043.phpt
@@ -9,7 +9,7 @@ function test(mixed $var) {
try {
match($var) {};
} catch (UnhandledMatchError $e) {
- print $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -27,14 +27,14 @@ test(str_repeat('e', 100));
test(str_repeat("e\n", 100));
?>
--EXPECT--
-Unhandled match case NULL
-Unhandled match case 1
-Unhandled match case 5.5
-Unhandled match case 5.0
-Unhandled match case 'foo'
-Unhandled match case true
-Unhandled match case false
-Unhandled match case of type array
-Unhandled match case of type Beep
-Unhandled match case 'eeeeeeeeeeeeeee...'
-Unhandled match case 'e\ne\ne\ne\ne\ne\ne\ne...'
+UnhandledMatchError: Unhandled match case NULL
+UnhandledMatchError: Unhandled match case 1
+UnhandledMatchError: Unhandled match case 5.5
+UnhandledMatchError: Unhandled match case 5.0
+UnhandledMatchError: Unhandled match case 'foo'
+UnhandledMatchError: Unhandled match case true
+UnhandledMatchError: Unhandled match case false
+UnhandledMatchError: Unhandled match case of type array
+UnhandledMatchError: Unhandled match case of type Beep
+UnhandledMatchError: Unhandled match case 'eeeeeeeeeeeeeee...'
+UnhandledMatchError: Unhandled match case 'e\ne\ne\ne\ne\ne\ne\ne...'
diff --git a/Zend/tests/match/045.phpt b/Zend/tests/match/045.phpt
index da8991cf595c..0857c6734af2 100644
--- a/Zend/tests/match/045.phpt
+++ b/Zend/tests/match/045.phpt
@@ -11,8 +11,8 @@ function test() {
try {
test();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined constant "x"
+Error: Undefined constant "x"
diff --git a/Zend/tests/match/048.phpt b/Zend/tests/match/048.phpt
index e5c6bb2e0bcb..11f6508b2efd 100644
--- a/Zend/tests/match/048.phpt
+++ b/Zend/tests/match/048.phpt
@@ -11,7 +11,7 @@ function test(mixed $var) {
try {
match($var) {};
} catch (UnhandledMatchError $e) {
- print $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -29,14 +29,14 @@ test(str_repeat('e', 100));
test(str_repeat("e\n", 100));
?>
--EXPECT--
-Unhandled match case NULL
-Unhandled match case 1
-Unhandled match case 5.5
-Unhandled match case 5.0
-Unhandled match case of type string
-Unhandled match case true
-Unhandled match case false
-Unhandled match case of type array
-Unhandled match case of type Beep
-Unhandled match case of type string
-Unhandled match case of type string
+UnhandledMatchError: Unhandled match case NULL
+UnhandledMatchError: Unhandled match case 1
+UnhandledMatchError: Unhandled match case 5.5
+UnhandledMatchError: Unhandled match case 5.0
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case true
+UnhandledMatchError: Unhandled match case false
+UnhandledMatchError: Unhandled match case of type array
+UnhandledMatchError: Unhandled match case of type Beep
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type string
diff --git a/Zend/tests/match/049.phpt b/Zend/tests/match/049.phpt
index 2a2385f704ff..05d68e4b33da 100644
--- a/Zend/tests/match/049.phpt
+++ b/Zend/tests/match/049.phpt
@@ -11,7 +11,7 @@ function test(mixed $var) {
try {
match($var) {};
} catch (UnhandledMatchError $e) {
- print $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -29,14 +29,14 @@ test(str_repeat('e', 100));
test(str_repeat("e\n", 100));
?>
--EXPECT--
-Unhandled match case of type null
-Unhandled match case of type int
-Unhandled match case of type float
-Unhandled match case of type float
-Unhandled match case of type string
-Unhandled match case of type bool
-Unhandled match case of type bool
-Unhandled match case of type array
-Unhandled match case of type Beep
-Unhandled match case of type string
-Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type null
+UnhandledMatchError: Unhandled match case of type int
+UnhandledMatchError: Unhandled match case of type float
+UnhandledMatchError: Unhandled match case of type float
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type bool
+UnhandledMatchError: Unhandled match case of type bool
+UnhandledMatchError: Unhandled match case of type array
+UnhandledMatchError: Unhandled match case of type Beep
+UnhandledMatchError: Unhandled match case of type string
+UnhandledMatchError: Unhandled match case of type string
diff --git a/Zend/tests/match/unmatched_enum.phpt b/Zend/tests/match/unmatched_enum.phpt
index 93f368a316b6..a92d905fbe83 100644
--- a/Zend/tests/match/unmatched_enum.phpt
+++ b/Zend/tests/match/unmatched_enum.phpt
@@ -13,9 +13,9 @@ try {
Foo::Baz => 42,
};
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unhandled match case Foo::Bar
+UnhandledMatchError: Unhandled match case Foo::Bar
diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt
index 7a8ab5a2647b..c1ea2867f0c6 100644
--- a/Zend/tests/methods-on-non-objects-call-user-func.phpt
+++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt
@@ -6,8 +6,8 @@ $comparator = null;
try {
var_dump(call_user_func([$comparator, 'compare'], 1, 2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
diff --git a/Zend/tests/methods-on-non-objects-catch.phpt b/Zend/tests/methods-on-non-objects-catch.phpt
index b090437084ff..2c2bbd7c1072 100644
--- a/Zend/tests/methods-on-non-objects-catch.phpt
+++ b/Zend/tests/methods-on-non-objects-catch.phpt
@@ -10,11 +10,10 @@ $x= null;
try {
var_dump($x->method());
} catch (Error $e) {
- var_dump($e->getCode(), $e->getMessage());
+ echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n";
}
echo "Alive\n";
?>
--EXPECTF--
-int(0)
-string(%d) "Call to a member function method() on null"
+Error: 0: Call to a member function method() on null
Alive
diff --git a/Zend/tests/methods-on-non-objects-usort.phpt b/Zend/tests/methods-on-non-objects-usort.phpt
index 8a89023b7e81..3d216af74c3d 100644
--- a/Zend/tests/methods-on-non-objects-usort.phpt
+++ b/Zend/tests/methods-on-non-objects-usort.phpt
@@ -12,7 +12,7 @@ usort($list, function($a, $b) use ($comparator) {
try {
return $comparator->compare($a, $b);
} catch (Error $e) {
- var_dump($e->getCode(), $e->getMessage());
+ echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n";
return 0;
}
});
@@ -20,14 +20,10 @@ var_dump($list);
echo "Alive\n";
?>
--EXPECT--
-int(0)
-string(43) "Call to a member function compare() on null"
-int(0)
-string(43) "Call to a member function compare() on null"
-int(0)
-string(43) "Call to a member function compare() on null"
-int(0)
-string(43) "Call to a member function compare() on null"
+Error: 0: Call to a member function compare() on null
+Error: 0: Call to a member function compare() on null
+Error: 0: Call to a member function compare() on null
+Error: 0: Call to a member function compare() on null
array(5) {
[0]=>
int(1)
diff --git a/Zend/tests/mod_001.phpt b/Zend/tests/mod_001.phpt
index 5c543a26192c..6c161efe323f 100644
--- a/Zend/tests/mod_001.phpt
+++ b/Zend/tests/mod_001.phpt
@@ -10,11 +10,11 @@ try {
$c = $a % $b;
var_dump($c);
} catch (TypeError $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array % array
+TypeError: Unsupported operand types: array % array
Done
diff --git a/Zend/tests/mul_001.phpt b/Zend/tests/mul_001.phpt
index ddb657685302..3ead1f34e1ac 100644
--- a/Zend/tests/mul_001.phpt
+++ b/Zend/tests/mul_001.phpt
@@ -9,7 +9,7 @@ $b = array(1);
try {
var_dump($a * $b);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $a * $b;
@@ -18,7 +18,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array * array
+TypeError: Unsupported operand types: array * array
Fatal error: Uncaught TypeError: Unsupported operand types: array * array in %s:%d
Stack trace:
diff --git a/Zend/tests/named_params/__invoke.phpt b/Zend/tests/named_params/__invoke.phpt
index 6ebbac0f07f4..f50743b8d8f7 100644
--- a/Zend/tests/named_params/__invoke.phpt
+++ b/Zend/tests/named_params/__invoke.phpt
@@ -22,7 +22,7 @@ $test(b: 'B');
try {
$test(b: 'B', c: 'C');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -39,14 +39,14 @@ $test3(b: 'B');
try {
$test3(b: 'B', c: 'C');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
a: A, b: B
a: a, b: B
-Unknown named parameter $c
+Error: Unknown named parameter $c
a: A, b: B
array(1) {
@@ -61,4 +61,4 @@ array(1) {
a: A, b: B
a: a, b: B
-Unknown named parameter $c
+Error: Unknown named parameter $c
diff --git a/Zend/tests/named_params/assert.phpt b/Zend/tests/named_params/assert.phpt
index 40a92a2f1fec..a65ae460126c 100644
--- a/Zend/tests/named_params/assert.phpt
+++ b/Zend/tests/named_params/assert.phpt
@@ -7,24 +7,24 @@ assert(assertion: true);
try {
assert(assertion: false);
} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
assert(assertion: true, description: "Description");
try {
assert(assertion: false, description: "Description");
} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(description: "Description");
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(assertion: false)
-Description
-Named parameter $description overwrites previous argument
+AssertionError: assert(assertion: false)
+AssertionError: Description
+Error: Named parameter $description overwrites previous argument
diff --git a/Zend/tests/named_params/attributes.phpt b/Zend/tests/named_params/attributes.phpt
index 94d2fad19f4d..9b16feb724d7 100644
--- a/Zend/tests/named_params/attributes.phpt
+++ b/Zend/tests/named_params/attributes.phpt
@@ -27,7 +27,7 @@ $attr = (new ReflectionClass(Test2::class))->getAttributes()[0];
try {
var_dump($attr->newInstance());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -47,4 +47,4 @@ object(MyAttribute)#1 (3) {
["c"]=>
string(1) "C"
}
-Named parameter $a overwrites previous argument
+Error: Named parameter $a overwrites previous argument
diff --git a/Zend/tests/named_params/call_user_func.phpt b/Zend/tests/named_params/call_user_func.phpt
index 50f2ed588e92..a11198a7fca3 100644
--- a/Zend/tests/named_params/call_user_func.phpt
+++ b/Zend/tests/named_params/call_user_func.phpt
@@ -37,17 +37,17 @@ var_dump(call_user_func('call_user_func', $test, c: 'D'));
try {
call_user_func($test_required, b: 'B');
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(call_user_func('array_slice', [1, 2, 3, 4, 5], length: 2));
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(call_user_func('array_slice', [1, 2, 3, 4, 'x' => 5], 3, preserve_keys: true));
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -82,8 +82,8 @@ array(2) {
Warning: {closure:%s:%d}(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
a = a, b = b, c = D
NULL
-{closure:%s:%d}(): Argument #1 ($a) not passed
-array_slice(): Argument #2 ($offset) not passed
+ArgumentCountError: {closure:%s:%d}(): Argument #1 ($a) not passed
+ArgumentCountError: array_slice(): Argument #2 ($offset) not passed
array(2) {
[3]=>
int(4)
diff --git a/Zend/tests/named_params/call_user_func_array.phpt b/Zend/tests/named_params/call_user_func_array.phpt
index ebee06ea6af7..8dde83574c17 100644
--- a/Zend/tests/named_params/call_user_func_array.phpt
+++ b/Zend/tests/named_params/call_user_func_array.phpt
@@ -18,12 +18,12 @@ namespace {
try {
call_user_func_array($test, ['d' => 'D']);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func_array($test, ['c' => 'C', 'A']);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
}
@@ -36,12 +36,12 @@ namespace Foo {
try {
call_user_func_array($test, ['d' => 'D']);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func_array($test, ['c' => 'C', 'A']);
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -56,8 +56,8 @@ array(2) {
["c"]=>
string(1) "C"
}
-Unknown named parameter $d
-Cannot use positional argument after named argument
+Error: Unknown named parameter $d
+Error: Cannot use positional argument after named argument
a = A, b = B, c = c
a = A, b = B, c = c
@@ -68,5 +68,5 @@ array(2) {
["c"]=>
string(1) "C"
}
-Unknown named parameter $d
-Cannot use positional argument after named argument
+Error: Unknown named parameter $d
+Error: Cannot use positional argument after named argument
diff --git a/Zend/tests/named_params/cannot_pass_by_ref.phpt b/Zend/tests/named_params/cannot_pass_by_ref.phpt
index a910cd4410c4..fd77fff70ebd 100644
--- a/Zend/tests/named_params/cannot_pass_by_ref.phpt
+++ b/Zend/tests/named_params/cannot_pass_by_ref.phpt
@@ -6,8 +6,8 @@ function test($a, &$e) {}
try {
test(e: 42);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-test(): Argument #2 ($e) could not be passed by reference
+Error: test(): Argument #2 ($e) could not be passed by reference
diff --git a/Zend/tests/named_params/ctor_extra_named_args.phpt b/Zend/tests/named_params/ctor_extra_named_args.phpt
index ae569ea65d39..76490a76cf4f 100644
--- a/Zend/tests/named_params/ctor_extra_named_args.phpt
+++ b/Zend/tests/named_params/ctor_extra_named_args.phpt
@@ -8,16 +8,16 @@ class Test {}
try {
new stdClass(x: "nope");
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new Test(x: "nope");
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unknown named parameter $x
-Unknown named parameter $x
+Error: Unknown named parameter $x
+Error: Unknown named parameter $x
diff --git a/Zend/tests/named_params/duplicate_param.phpt b/Zend/tests/named_params/duplicate_param.phpt
index 6abc95bba0fb..04cd76134ce8 100644
--- a/Zend/tests/named_params/duplicate_param.phpt
+++ b/Zend/tests/named_params/duplicate_param.phpt
@@ -8,16 +8,16 @@ function test($a) {}
try {
test(a: 1, a: 2);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(1, a: 2);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Named parameter $a overwrites previous argument
-Named parameter $a overwrites previous argument
+Error: Named parameter $a overwrites previous argument
+Error: Named parameter $a overwrites previous argument
diff --git a/Zend/tests/named_params/gh17216.phpt b/Zend/tests/named_params/gh17216.phpt
index 4cb4df0ec431..0fc0349983df 100644
--- a/Zend/tests/named_params/gh17216.phpt
+++ b/Zend/tests/named_params/gh17216.phpt
@@ -13,10 +13,10 @@ $array = ["a" => "b", 1];
try {
forward_static_call_array($callback, $array);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
-Cannot use positional argument after named argument
+Error: Cannot use positional argument after named argument
Done
diff --git a/Zend/tests/named_params/internal_variadics.phpt b/Zend/tests/named_params/internal_variadics.phpt
index 8312bde406d2..ecad7f5c83e0 100644
--- a/Zend/tests/named_params/internal_variadics.phpt
+++ b/Zend/tests/named_params/internal_variadics.phpt
@@ -6,23 +6,23 @@ Named params on internal functions: Variadic functions that don't support extra
try {
array_merge([1, 2], a: [3, 4]);
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_diff_key([1, 2], [3, 4], a: [5, 6]);
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$array = [1, 2];
array_push($array, ...['values' => 3]);
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Internal function array_merge() does not accept named variadic arguments
-Internal function array_diff_key() does not accept named variadic arguments
-Internal function array_push() does not accept named variadic arguments
+ArgumentCountError: Internal function array_merge() does not accept named variadic arguments
+ArgumentCountError: Internal function array_diff_key() does not accept named variadic arguments
+ArgumentCountError: Internal function array_push() does not accept named variadic arguments
diff --git a/Zend/tests/named_params/missing_param.phpt b/Zend/tests/named_params/missing_param.phpt
index f8b0b356ceeb..a213c834df5d 100644
--- a/Zend/tests/named_params/missing_param.phpt
+++ b/Zend/tests/named_params/missing_param.phpt
@@ -9,19 +9,19 @@ function test($a, $b, $c, $d) {
try {
test(a: 'a', d: 'd');
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_keys(strict: true);
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_keys([], strict: true);
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// This works fine, as search_value is explicitly specified.
@@ -29,9 +29,9 @@ var_dump(array_keys([41, 42], filter_value: 42, strict: true));
?>
--EXPECT--
-test(): Argument #2 ($b) not passed
-array_keys(): Argument #1 ($array) not passed
-array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known
+ArgumentCountError: test(): Argument #2 ($b) not passed
+ArgumentCountError: array_keys(): Argument #1 ($array) not passed
+ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known
array(1) {
[0]=>
int(1)
diff --git a/Zend/tests/named_params/unknown_named_param.phpt b/Zend/tests/named_params/unknown_named_param.phpt
index 5a18932ffd17..b005674c35df 100644
--- a/Zend/tests/named_params/unknown_named_param.phpt
+++ b/Zend/tests/named_params/unknown_named_param.phpt
@@ -12,36 +12,36 @@ function test2(...$a) {
try {
test(b: 42);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(b: new stdClass);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(b: 2, a: 1);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...new ArrayIterator(['unknown' => 42]));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2(a: 42);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unknown named parameter $b
-Unknown named parameter $b
-Unknown named parameter $b
-Unknown named parameter $unknown
+Error: Unknown named parameter $b
+Error: Unknown named parameter $b
+Error: Unknown named parameter $b
+Error: Unknown named parameter $unknown
diff --git a/Zend/tests/named_params/unpack.phpt b/Zend/tests/named_params/unpack.phpt
index 92bb4792c3e5..018ccf69a642 100644
--- a/Zend/tests/named_params/unpack.phpt
+++ b/Zend/tests/named_params/unpack.phpt
@@ -18,13 +18,13 @@ test(...['a', 'b' => 'b', 'c' => 'c']);
try {
test(...['a', 'b' => 'b', 'c']);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...['a', 'a' => 'a']);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ary = ['b' => 0];
@@ -39,13 +39,13 @@ test(...new ArrayIterator(['a', 'b' => 'b', 'c' => 'c']));
try {
test(...new ArrayIterator(['a', 'b' => 'b', 'c']));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...new ArrayIterator(['a', 'a' => 'a']));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ary = ['b' => 0];
@@ -58,8 +58,8 @@ var_dump($ary, $ary2);
a = a, b = b, c = c
a = a, b = b, c = c
a = a, b = b, c = c
-Cannot use positional argument after named argument during unpacking
-Named parameter $a overwrites previous argument
+Error: Cannot use positional argument after named argument during unpacking
+Error: Named parameter $a overwrites previous argument
array(1) {
["b"]=>
int(1)
@@ -71,8 +71,8 @@ array(1) {
a = a, b = b, c = c
a = a, b = b, c = c
a = a, b = b, c = c
-Cannot use positional argument after named argument during unpacking
-Named parameter $a overwrites previous argument
+Error: Cannot use positional argument after named argument during unpacking
+Error: Named parameter $a overwrites previous argument
Warning: Cannot pass by-reference argument 2 of test2() by unpacking a Traversable, passing by-value instead in %s on line %d
array(1) {
diff --git a/Zend/tests/named_params/unpack_and_named_1.phpt b/Zend/tests/named_params/unpack_and_named_1.phpt
index 1e08163724d4..e1177347b461 100644
--- a/Zend/tests/named_params/unpack_and_named_1.phpt
+++ b/Zend/tests/named_params/unpack_and_named_1.phpt
@@ -20,12 +20,12 @@ test2(...['b' => 2, 'a' => 1], d: 40);
try {
test2(...[1, 2], b: 20);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2(...[1, 'b' => 2], b: 20);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -54,5 +54,5 @@ int(1)
int(2)
int(3)
int(40)
-Named parameter $b overwrites previous argument
-Named parameter $b overwrites previous argument
+Error: Named parameter $b overwrites previous argument
+Error: Named parameter $b overwrites previous argument
diff --git a/Zend/tests/namespaces/ns_076.phpt b/Zend/tests/namespaces/ns_076.phpt
index 230b498b54ac..73c610399b40 100644
--- a/Zend/tests/namespaces/ns_076.phpt
+++ b/Zend/tests/namespaces/ns_076.phpt
@@ -8,23 +8,23 @@ use Error;
try {
$a = array(unknown => unknown);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo unknown;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo \unknown;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined constant "foo\unknown"
-Undefined constant "foo\unknown"
-Undefined constant "unknown"
+Error: Undefined constant "foo\unknown"
+Error: Undefined constant "foo\unknown"
+Error: Undefined constant "unknown"
diff --git a/Zend/tests/not_002.phpt b/Zend/tests/not_002.phpt
index 3282053b6b9d..273325a6aafa 100644
--- a/Zend/tests/not_002.phpt
+++ b/Zend/tests/not_002.phpt
@@ -9,7 +9,7 @@ $b = array(1,2);
try {
var_dump(~$b);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$a = ~$b;
@@ -18,7 +18,7 @@ var_dump($a);
echo "Done\n";
?>
--EXPECTF--
-Exception: Cannot perform bitwise not on array
+TypeError: Cannot perform bitwise not on array
Fatal error: Uncaught TypeError: Cannot perform bitwise not on array in %s:%d
Stack trace:
diff --git a/Zend/tests/nullsafe_operator/001.phpt b/Zend/tests/nullsafe_operator/001.phpt
index 22776006a717..8e0affeb3ec4 100644
--- a/Zend/tests/nullsafe_operator/001.phpt
+++ b/Zend/tests/nullsafe_operator/001.phpt
@@ -45,7 +45,7 @@ var_dump($foo->self(null?->bar())->null());
try {
var_dump($foo?->self()[null?->bar()]);
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -103,4 +103,4 @@ string(11) "Foo::self()"
string(11) "Foo::null()"
NULL
string(11) "Foo::self()"
-string(38) "Cannot use object of type Foo as array"
+Error: Cannot use object of type Foo as array
diff --git a/Zend/tests/nullsafe_operator/002.phpt b/Zend/tests/nullsafe_operator/002.phpt
index 87642bdcb5f0..19439bdd892d 100644
--- a/Zend/tests/nullsafe_operator/002.phpt
+++ b/Zend/tests/nullsafe_operator/002.phpt
@@ -6,37 +6,37 @@ Test nullsafe strict type check
try {
false?->bar();
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
[]?->bar();
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(0)?->bar();
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(0.0)?->bar();
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
''?->bar();
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(40) "Call to a member function bar() on false"
-string(40) "Call to a member function bar() on array"
-string(38) "Call to a member function bar() on int"
-string(40) "Call to a member function bar() on float"
-string(41) "Call to a member function bar() on string"
+Error: Call to a member function bar() on false
+Error: Call to a member function bar() on array
+Error: Call to a member function bar() on int
+Error: Call to a member function bar() on float
+Error: Call to a member function bar() on string
diff --git a/Zend/tests/nullsafe_operator/003.phpt b/Zend/tests/nullsafe_operator/003.phpt
index 83c2863d1a10..4164ffab9f97 100644
--- a/Zend/tests/nullsafe_operator/003.phpt
+++ b/Zend/tests/nullsafe_operator/003.phpt
@@ -25,7 +25,7 @@ var_dump($foo?->qux());
try {
var_dump($foo?->quux());
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump((new Foo)?->bar);
@@ -34,7 +34,7 @@ var_dump((new Foo)?->qux());
try {
var_dump((new Foo)?->quux());
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -48,10 +48,10 @@ string(3) "bar"
Warning: Undefined property: Foo::$baz in %s.php on line 20
NULL
string(3) "qux"
-string(36) "Call to undefined method Foo::quux()"
+Error: Call to undefined method Foo::quux()
string(3) "bar"
Warning: Undefined property: Foo::$baz in %s.php on line 29
NULL
string(3) "qux"
-string(36) "Call to undefined method Foo::quux()"
+Error: Call to undefined method Foo::quux()
diff --git a/Zend/tests/nullsafe_operator/013.phpt b/Zend/tests/nullsafe_operator/013.phpt
index ea3539954891..775397a941ad 100644
Binary files a/Zend/tests/nullsafe_operator/013.phpt and b/Zend/tests/nullsafe_operator/013.phpt differ
diff --git a/Zend/tests/nullsafe_operator/014.phpt b/Zend/tests/nullsafe_operator/014.phpt
index 896e831ec9fa..b09ace2b1806 100644
--- a/Zend/tests/nullsafe_operator/014.phpt
+++ b/Zend/tests/nullsafe_operator/014.phpt
@@ -7,7 +7,7 @@ function try_and_dump($fn) {
try {
var_dump($fn());
} catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -40,8 +40,8 @@ bar
int(0)
bar
int(0)
-Call to a member function null() on null
-Call to a member function null() on null
+Error: Call to a member function null() on null
+Error: Call to a member function null() on null
bar
bar
-Call to a member function baz() on int
+Error: Call to a member function baz() on int
diff --git a/Zend/tests/nullsafe_operator/016.phpt b/Zend/tests/nullsafe_operator/016.phpt
index 5bc8516ae4b9..f8e35c25b0af 100644
--- a/Zend/tests/nullsafe_operator/016.phpt
+++ b/Zend/tests/nullsafe_operator/016.phpt
@@ -15,12 +15,12 @@ function test($foo) {
try {
set($foo?->bar, 'bar');
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(strrev('tes'))($foo?->bar, 'bar2');
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -29,7 +29,7 @@ test(new Foo());
?>
--EXPECT--
-set(): Argument #1 ($ref) could not be passed by reference
-set(): Argument #1 ($ref) could not be passed by reference
-set(): Argument #1 ($ref) could not be passed by reference
-set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
+Error: set(): Argument #1 ($ref) could not be passed by reference
diff --git a/Zend/tests/nullsafe_operator/026.phpt b/Zend/tests/nullsafe_operator/026.phpt
index c4e825febbc5..ba34aa11e0a2 100644
--- a/Zend/tests/nullsafe_operator/026.phpt
+++ b/Zend/tests/nullsafe_operator/026.phpt
@@ -11,16 +11,16 @@ $null = null;
try {
Test::${$null?->foo}->bar;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::{$null?->foo}()->bar;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Access to undeclared static property Test::$
-Method name must be a string
+Error: Access to undeclared static property Test::$
+Error: Method name must be a string
diff --git a/Zend/tests/nullsafe_operator/033.phpt b/Zend/tests/nullsafe_operator/033.phpt
index 63ee2f850a56..58579d325e04 100644
--- a/Zend/tests/nullsafe_operator/033.phpt
+++ b/Zend/tests/nullsafe_operator/033.phpt
@@ -25,7 +25,7 @@ var_dump("{$foo?->qux()}");
try {
var_dump("{$foo?->quux()}");
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump("$foo?->bar");
@@ -34,7 +34,7 @@ var_dump("$foo?->qux()");
try {
var_dump("$foo?->quux()");
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -48,7 +48,7 @@ string(3) "bar"
Warning: Undefined property: Foo::$baz in %s.php on line 20
string(0) ""
string(3) "qux"
-string(36) "Call to undefined method Foo::quux()"
+Error: Call to undefined method Foo::quux()
string(3) "bar"
Warning: Undefined property: Foo::$baz in %s.php on line 29
diff --git a/Zend/tests/nullsafe_operator/039.phpt b/Zend/tests/nullsafe_operator/039.phpt
index 92983c1592e0..20e209143714 100644
--- a/Zend/tests/nullsafe_operator/039.phpt
+++ b/Zend/tests/nullsafe_operator/039.phpt
@@ -10,9 +10,9 @@ set_error_handler(function($_, $m) {
try {
$foo?->foo;
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined variable $foo
+Exception: Undefined variable $foo
diff --git a/Zend/tests/nullsafe_operator/constant_propagation.phpt b/Zend/tests/nullsafe_operator/constant_propagation.phpt
index e41201d0e496..7660f20d1a7e 100644
--- a/Zend/tests/nullsafe_operator/constant_propagation.phpt
+++ b/Zend/tests/nullsafe_operator/constant_propagation.phpt
@@ -8,9 +8,9 @@ class Bar { const FOO = "foo"; }
try {
Bar::FOO?->length();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to a member function length() on string
+Error: Call to a member function length() on string
diff --git a/Zend/tests/number_or_str_zpp.phpt b/Zend/tests/number_or_str_zpp.phpt
index 6ee47ec6f63d..2548e0499ec0 100644
--- a/Zend/tests/number_or_str_zpp.phpt
+++ b/Zend/tests/number_or_str_zpp.phpt
@@ -23,12 +23,12 @@ var_dump(zend_number_or_string(new ToString()));
try {
zend_string_or_object([]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
zend_number_or_string(new Foo());
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(zend_number_or_string_or_null("string"));
@@ -42,12 +42,12 @@ var_dump(zend_number_or_string_or_null(new ToString()));
try {
zend_number_or_string_or_null([]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
zend_number_or_string_or_null(new Foo());
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
@@ -61,8 +61,8 @@ int(0)
int(0)
int(1)
string(8) "ToString"
-zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given
-zend_number_or_string(): Argument #1 ($param) must be of type string|int|float, Foo given
+TypeError: zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given
+TypeError: zend_number_or_string(): Argument #1 ($param) must be of type string|int|float, Foo given
string(6) "string"
int(1)
float(5.5)
@@ -70,5 +70,5 @@ NULL
int(0)
int(1)
string(8) "ToString"
-zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, array given
-zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, Foo given
+TypeError: zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, array given
+TypeError: zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, Foo given
diff --git a/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt b/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt
index 51df22634869..39d2d3a60beb 100644
--- a/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt
+++ b/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt
@@ -16,7 +16,7 @@ try {
$a += "sit";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("5 amet,");
@@ -27,7 +27,7 @@ try {
$a -= "elit,";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("11 sed");
@@ -38,7 +38,7 @@ try {
$a *= "tempor";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("17 incididunt");
@@ -49,7 +49,7 @@ try {
$a /= "et";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("23 dolore");
@@ -60,7 +60,7 @@ try {
$a **= "Ut";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("31 enim");
@@ -71,7 +71,7 @@ try {
$a %= "veniam,";
var_dump($a);
} catch (\TypeError $e) {
- echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("41 minim");
@@ -81,7 +81,7 @@ try {
$a = foxcache("quis");
$a <<= "nostrud";
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($a);
echo "---", PHP_EOL;
@@ -93,7 +93,7 @@ try {
$a >>= "nisi";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("59 ut");
@@ -107,14 +107,14 @@ try {
$a |= 73;
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$a = foxcache(79);
$a |= "ea";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("83 commodo");
@@ -128,14 +128,14 @@ try {
$a &= 103;
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$a = foxcache(107);
$a &= "aute";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
$a = foxcache("109 irure");
@@ -149,14 +149,14 @@ try {
$a ^= 137;
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$a = foxcache(139);
$a ^= "reprehenderit";
var_dump($a);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
@@ -164,35 +164,35 @@ Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(5)
-Unsupported operand types: string + string
+TypeError: Unsupported operand types: string + string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(-2)
-Unsupported operand types: string - string
+TypeError: Unsupported operand types: string - string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(143)
-Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
float(0.8947368421052632)
-Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
float(3.0910586430935376E+39)
-Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -206,7 +206,7 @@ Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(%d)
-Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
string(4) "quis"
---
@@ -214,7 +214,7 @@ Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(0)
-Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -222,8 +222,8 @@ int(63)
Warning: A non-numeric value encountered in %s on line %d
int(71)
-Unsupported operand types: string | int
-Unsupported operand types: int | string
+TypeError: Unsupported operand types: string | int
+TypeError: Unsupported operand types: int | string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -231,8 +231,8 @@ int(81)
Warning: A non-numeric value encountered in %s on line %d
int(97)
-Unsupported operand types: string & int
-Unsupported operand types: int & string
+TypeError: Unsupported operand types: string & int
+TypeError: Unsupported operand types: int & string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -240,5 +240,5 @@ int(28)
Warning: A non-numeric value encountered in %s on line %d
int(252)
-Unsupported operand types: string ^ int
-Unsupported operand types: int ^ string
+TypeError: Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: int ^ string
diff --git a/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt b/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt
index 2b76f538f46e..ab508a3391a9 100644
--- a/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt
+++ b/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt
@@ -7,56 +7,56 @@ var_dump("2 Lorem" + "3 ipsum");
try {
var_dump("dolor" + "sit");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("5 amet," - "7 consectetur");
try {
var_dump("adipiscing" - "elit,");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("11 sed" * "13 do");
try {
var_dump("eiusmod" * "tempor");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("17 incididunt" / "19 ut");
try {
var_dump("labore" / "et");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("23 dolore" ** "29 magna");
try {
var_dump("aliqua." ** "Ut");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("31 enim" % "37 ad");
try {
var_dump("minim" % "veniam,");
} catch (\TypeError $e) {
- echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("41 minim" << "43 veniam,");
try {
var_dump("quis" << "nostrud");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("47 exercitation" >> "53 ullamco");
try {
var_dump("laboris" >> "nisi");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("59 ut" | 61);
@@ -64,12 +64,12 @@ var_dump(67 | "71 aliquip");
try {
var_dump("ex" | 73);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(79 | "ea");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("83 commodo" & 89);
@@ -77,12 +77,12 @@ var_dump(97 & "101 consequat.");
try {
var_dump("Duis" & 103);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(107 & "aute");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump("109 irure" ^ 113);
@@ -90,26 +90,26 @@ var_dump(127 ^ "131 dolor");
try {
var_dump("in" ^ 137);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(139 ^ "reprehenderit");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump(+"149 in");
try {
var_dump(+"voluptate");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "---", PHP_EOL;
var_dump(-"151 velit");
try {
var_dump(-"esse");
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
@@ -117,35 +117,35 @@ Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(5)
-Unsupported operand types: string + string
+TypeError: Unsupported operand types: string + string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(-2)
-Unsupported operand types: string - string
+TypeError: Unsupported operand types: string - string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(143)
-Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
float(0.8947368421052632)
-Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
float(3.0910586430935376E+39)
-Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -159,14 +159,14 @@ Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(%d)
-Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
---
Warning: A non-numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
int(0)
-Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -174,8 +174,8 @@ int(63)
Warning: A non-numeric value encountered in %s on line %d
int(71)
-Unsupported operand types: string | int
-Unsupported operand types: int | string
+TypeError: Unsupported operand types: string | int
+TypeError: Unsupported operand types: int | string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -183,8 +183,8 @@ int(81)
Warning: A non-numeric value encountered in %s on line %d
int(97)
-Unsupported operand types: string & int
-Unsupported operand types: int & string
+TypeError: Unsupported operand types: string & int
+TypeError: Unsupported operand types: int & string
---
Warning: A non-numeric value encountered in %s on line %d
@@ -192,15 +192,15 @@ int(28)
Warning: A non-numeric value encountered in %s on line %d
int(252)
-Unsupported operand types: string ^ int
-Unsupported operand types: int ^ string
+TypeError: Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: int ^ string
---
Warning: A non-numeric value encountered in %s on line %d
int(149)
-Unsupported operand types: string * int
+TypeError: Unsupported operand types: string * int
---
Warning: A non-numeric value encountered in %s on line %d
int(-151)
-Unsupported operand types: string * int
+TypeError: Unsupported operand types: string * int
diff --git a/Zend/tests/numeric_strings/string_offset.phpt b/Zend/tests/numeric_strings/string_offset.phpt
index 0c43bc151210..01948437ef04 100644
--- a/Zend/tests/numeric_strings/string_offset.phpt
+++ b/Zend/tests/numeric_strings/string_offset.phpt
@@ -31,7 +31,7 @@ foreach ($keys as $key) {
try {
var_dump($str[$key]);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -39,29 +39,29 @@ echo "Done\n";
?>
--EXPECTF--
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "7str" in %s on line %d
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset " 7str" in %s on line %d
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset " 7 str" in %s on line %d
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "7 str" in %s on line %d
string(1) "l"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "0xC" in %s on line %d
string(1) "T"
diff --git a/Zend/tests/offset_array.phpt b/Zend/tests/offset_array.phpt
index e50ffad18cb2..a84a3bf48e0b 100644
--- a/Zend/tests/offset_array.phpt
+++ b/Zend/tests/offset_array.phpt
@@ -20,14 +20,14 @@ $obj = new stdClass;
try {
var_dump($arr[$obj]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr1 = Array(1,2,3);
try {
var_dump($arr[$arr1]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
@@ -50,6 +50,6 @@ int(1)
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
int(%d)
-Cannot access offset of type stdClass on array
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type stdClass on array
+TypeError: Cannot access offset of type array on array
Done
diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt
index a32a68265689..a622f0e24545 100644
--- a/Zend/tests/offset_string.phpt
+++ b/Zend/tests/offset_string.phpt
@@ -11,13 +11,13 @@ var_dump($str[NULL]);
try {
var_dump($str["run away"]);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($str["13"]);
try {
var_dump($str["14.5"]);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($str["15 and then some"]);
@@ -28,21 +28,21 @@ $fp = fopen(__FILE__, "r");
try {
var_dump($str[$fp]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj = new stdClass;
try {
var_dump($str[$obj]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr = Array(1,2,3);
try {
var_dump($str[$arr]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
@@ -55,9 +55,9 @@ string(1) "S"
Warning: String offset cast occurred in %s on line %d
string(1) "S"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
string(1) "c"
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "15 and then some" in %s on line %d
string(1) "r"
@@ -67,7 +67,7 @@ string(1) "i"
Warning: String offset cast occurred in %s on line %d
string(1) "S"
-Cannot access offset of type resource on string
-Cannot access offset of type stdClass on string
-Cannot access offset of type array on string
+TypeError: Cannot access offset of type resource on string
+TypeError: Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type array on string
Done
diff --git a/Zend/tests/offsets/appending_containers.phpt b/Zend/tests/offsets/appending_containers.phpt
index 0372c28bf184..85eb50812468 100644
--- a/Zend/tests/offsets/appending_containers.phpt
+++ b/Zend/tests/offsets/appending_containers.phpt
@@ -11,7 +11,7 @@ foreach ($containers as $container) {
$container[] = 'value';
var_dump($container);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -30,26 +30,26 @@ array(1) {
string(5) "value"
}
true container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
4 container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
5.5 container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
'10' container:
-[] operator not supported for strings
+Error: [] operator not supported for strings
'25.5' container:
-[] operator not supported for strings
+Error: [] operator not supported for strings
'string' container:
-[] operator not supported for strings
+Error: [] operator not supported for strings
[] container:
array(1) {
[0]=>
string(5) "value"
}
STDERR container:
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
new stdClass() container:
-Cannot use object of type stdClass as array
+Error: Cannot use object of type stdClass as array
new ArrayObject() container:
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
diff --git a/Zend/tests/operator_unsupported_types.phpt b/Zend/tests/operator_unsupported_types.phpt
index 904ac402b372..e6923b4e64f3 100644
--- a/Zend/tests/operator_unsupported_types.phpt
+++ b/Zend/tests/operator_unsupported_types.phpt
@@ -46,7 +46,7 @@ function evalBinOp(string $op, string $value1, string $value2) {
eval("return $value1 $op $value2;");
echo "No error for $value1 $op $value2\n";
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -56,7 +56,7 @@ function evalAssignOp(string $op, string $value1, string $value2) {
eval("\$x $op= $value2;");
echo "No error for $value1 $op= $value2\n";
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
if ($x !== $origX) {
die("Value corrupted!");
}
@@ -101,7 +101,7 @@ foreach ($illegalValues as $illegalValue) {
eval("return ~$illegalValue;");
echo "No error for ~$illegalValue\n";
} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -112,14 +112,14 @@ foreach ($illegalValues as $illegalValue) {
$copy++;
echo "No error for $copy++\n";
} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$copy = eval("return $illegalValue;");
try {
$copy--;
echo "No error for $copy--\n";
} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -127,844 +127,844 @@ foreach ($illegalValues as $illegalValue) {
--EXPECT--
BINARY OP:
No error for [] + []
-Unsupported operand types: array + stdClass
-Unsupported operand types: array + resource
-Unsupported operand types: array + string
-Unsupported operand types: stdClass + array
-Unsupported operand types: stdClass + stdClass
-Unsupported operand types: stdClass + resource
-Unsupported operand types: stdClass + string
-Unsupported operand types: resource + array
-Unsupported operand types: resource + stdClass
-Unsupported operand types: resource + resource
-Unsupported operand types: resource + string
-Unsupported operand types: string + array
-Unsupported operand types: string + stdClass
-Unsupported operand types: string + resource
-Unsupported operand types: string + string
-Unsupported operand types: array + null
-Unsupported operand types: null + array
-Unsupported operand types: array + bool
-Unsupported operand types: bool + array
-Unsupported operand types: array + bool
-Unsupported operand types: bool + array
-Unsupported operand types: array + int
-Unsupported operand types: int + array
-Unsupported operand types: array + float
-Unsupported operand types: float + array
-Unsupported operand types: array + string
-Unsupported operand types: string + array
-Unsupported operand types: array + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + array
-Unsupported operand types: stdClass + null
-Unsupported operand types: null + stdClass
-Unsupported operand types: stdClass + bool
-Unsupported operand types: bool + stdClass
-Unsupported operand types: stdClass + bool
-Unsupported operand types: bool + stdClass
-Unsupported operand types: stdClass + int
-Unsupported operand types: int + stdClass
-Unsupported operand types: stdClass + float
-Unsupported operand types: float + stdClass
-Unsupported operand types: stdClass + string
-Unsupported operand types: string + stdClass
-Unsupported operand types: stdClass + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + stdClass
-Unsupported operand types: resource + null
-Unsupported operand types: null + resource
-Unsupported operand types: resource + bool
-Unsupported operand types: bool + resource
-Unsupported operand types: resource + bool
-Unsupported operand types: bool + resource
-Unsupported operand types: resource + int
-Unsupported operand types: int + resource
-Unsupported operand types: resource + float
-Unsupported operand types: float + resource
-Unsupported operand types: resource + string
-Unsupported operand types: string + resource
-Unsupported operand types: resource + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + resource
-Unsupported operand types: string + null
-Unsupported operand types: null + string
-Unsupported operand types: string + bool
-Unsupported operand types: bool + string
-Unsupported operand types: string + bool
-Unsupported operand types: bool + string
-Unsupported operand types: string + int
-Unsupported operand types: int + string
-Unsupported operand types: string + float
-Unsupported operand types: float + string
-Unsupported operand types: string + string
-Unsupported operand types: string + string
-Unsupported operand types: string + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + string
-Unsupported operand types: array - array
-Unsupported operand types: array - stdClass
-Unsupported operand types: array - resource
-Unsupported operand types: array - string
-Unsupported operand types: stdClass - array
-Unsupported operand types: stdClass - stdClass
-Unsupported operand types: stdClass - resource
-Unsupported operand types: stdClass - string
-Unsupported operand types: resource - array
-Unsupported operand types: resource - stdClass
-Unsupported operand types: resource - resource
-Unsupported operand types: resource - string
-Unsupported operand types: string - array
-Unsupported operand types: string - stdClass
-Unsupported operand types: string - resource
-Unsupported operand types: string - string
-Unsupported operand types: array - null
-Unsupported operand types: null - array
-Unsupported operand types: array - bool
-Unsupported operand types: bool - array
-Unsupported operand types: array - bool
-Unsupported operand types: bool - array
-Unsupported operand types: array - int
-Unsupported operand types: int - array
-Unsupported operand types: array - float
-Unsupported operand types: float - array
-Unsupported operand types: array - string
-Unsupported operand types: string - array
-Unsupported operand types: array - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - array
-Unsupported operand types: stdClass - null
-Unsupported operand types: null - stdClass
-Unsupported operand types: stdClass - bool
-Unsupported operand types: bool - stdClass
-Unsupported operand types: stdClass - bool
-Unsupported operand types: bool - stdClass
-Unsupported operand types: stdClass - int
-Unsupported operand types: int - stdClass
-Unsupported operand types: stdClass - float
-Unsupported operand types: float - stdClass
-Unsupported operand types: stdClass - string
-Unsupported operand types: string - stdClass
-Unsupported operand types: stdClass - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - stdClass
-Unsupported operand types: resource - null
-Unsupported operand types: null - resource
-Unsupported operand types: resource - bool
-Unsupported operand types: bool - resource
-Unsupported operand types: resource - bool
-Unsupported operand types: bool - resource
-Unsupported operand types: resource - int
-Unsupported operand types: int - resource
-Unsupported operand types: resource - float
-Unsupported operand types: float - resource
-Unsupported operand types: resource - string
-Unsupported operand types: string - resource
-Unsupported operand types: resource - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - resource
-Unsupported operand types: string - null
-Unsupported operand types: null - string
-Unsupported operand types: string - bool
-Unsupported operand types: bool - string
-Unsupported operand types: string - bool
-Unsupported operand types: bool - string
-Unsupported operand types: string - int
-Unsupported operand types: int - string
-Unsupported operand types: string - float
-Unsupported operand types: float - string
-Unsupported operand types: string - string
-Unsupported operand types: string - string
-Unsupported operand types: string - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - string
-Unsupported operand types: array * array
-Unsupported operand types: stdClass * array
-Unsupported operand types: resource * array
-Unsupported operand types: array * string
-Unsupported operand types: stdClass * array
-Unsupported operand types: stdClass * stdClass
-Unsupported operand types: stdClass * resource
-Unsupported operand types: stdClass * string
-Unsupported operand types: resource * array
-Unsupported operand types: resource * stdClass
-Unsupported operand types: resource * resource
-Unsupported operand types: resource * string
-Unsupported operand types: string * array
-Unsupported operand types: stdClass * string
-Unsupported operand types: resource * string
-Unsupported operand types: string * string
-Unsupported operand types: array * null
-Unsupported operand types: null * array
-Unsupported operand types: array * bool
-Unsupported operand types: bool * array
-Unsupported operand types: array * bool
-Unsupported operand types: bool * array
-Unsupported operand types: array * int
-Unsupported operand types: int * array
-Unsupported operand types: array * float
-Unsupported operand types: float * array
-Unsupported operand types: array * string
-Unsupported operand types: string * array
-Unsupported operand types: array * string
-Warning: A non-numeric value encountered
-Unsupported operand types: string * array
-Unsupported operand types: stdClass * null
-Unsupported operand types: stdClass * null
-Unsupported operand types: stdClass * bool
-Unsupported operand types: stdClass * bool
-Unsupported operand types: stdClass * bool
-Unsupported operand types: stdClass * bool
-Unsupported operand types: stdClass * int
-Unsupported operand types: stdClass * int
-Unsupported operand types: stdClass * float
-Unsupported operand types: stdClass * float
-Unsupported operand types: stdClass * string
-Unsupported operand types: stdClass * string
-Unsupported operand types: stdClass * string
-Unsupported operand types: stdClass * string
-Unsupported operand types: resource * null
-Unsupported operand types: resource * null
-Unsupported operand types: resource * bool
-Unsupported operand types: resource * bool
-Unsupported operand types: resource * bool
-Unsupported operand types: resource * bool
-Unsupported operand types: resource * int
-Unsupported operand types: resource * int
-Unsupported operand types: resource * float
-Unsupported operand types: resource * float
-Unsupported operand types: resource * string
-Unsupported operand types: resource * string
-Unsupported operand types: resource * string
-Unsupported operand types: resource * string
-Unsupported operand types: string * null
-Unsupported operand types: null * string
-Unsupported operand types: string * bool
-Unsupported operand types: bool * string
-Unsupported operand types: string * bool
-Unsupported operand types: bool * string
-Unsupported operand types: string * int
-Unsupported operand types: int * string
-Unsupported operand types: string * float
-Unsupported operand types: float * string
-Unsupported operand types: string * string
-Unsupported operand types: string * string
-Unsupported operand types: string * string
-Warning: A non-numeric value encountered
-Unsupported operand types: string * string
-Unsupported operand types: array / array
-Unsupported operand types: array / stdClass
-Unsupported operand types: array / resource
-Unsupported operand types: array / string
-Unsupported operand types: stdClass / array
-Unsupported operand types: stdClass / stdClass
-Unsupported operand types: stdClass / resource
-Unsupported operand types: stdClass / string
-Unsupported operand types: resource / array
-Unsupported operand types: resource / stdClass
-Unsupported operand types: resource / resource
-Unsupported operand types: resource / string
-Unsupported operand types: string / array
-Unsupported operand types: string / stdClass
-Unsupported operand types: string / resource
-Unsupported operand types: string / string
-Unsupported operand types: array / null
-Unsupported operand types: null / array
-Unsupported operand types: array / bool
-Unsupported operand types: bool / array
-Unsupported operand types: array / bool
-Unsupported operand types: bool / array
-Unsupported operand types: array / int
-Unsupported operand types: int / array
-Unsupported operand types: array / float
-Unsupported operand types: float / array
-Unsupported operand types: array / string
-Unsupported operand types: string / array
-Unsupported operand types: array / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / array
-Unsupported operand types: stdClass / null
-Unsupported operand types: null / stdClass
-Unsupported operand types: stdClass / bool
-Unsupported operand types: bool / stdClass
-Unsupported operand types: stdClass / bool
-Unsupported operand types: bool / stdClass
-Unsupported operand types: stdClass / int
-Unsupported operand types: int / stdClass
-Unsupported operand types: stdClass / float
-Unsupported operand types: float / stdClass
-Unsupported operand types: stdClass / string
-Unsupported operand types: string / stdClass
-Unsupported operand types: stdClass / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / stdClass
-Unsupported operand types: resource / null
-Unsupported operand types: null / resource
-Unsupported operand types: resource / bool
-Unsupported operand types: bool / resource
-Unsupported operand types: resource / bool
-Unsupported operand types: bool / resource
-Unsupported operand types: resource / int
-Unsupported operand types: int / resource
-Unsupported operand types: resource / float
-Unsupported operand types: float / resource
-Unsupported operand types: resource / string
-Unsupported operand types: string / resource
-Unsupported operand types: resource / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / resource
-Unsupported operand types: string / null
-Unsupported operand types: null / string
-Unsupported operand types: string / bool
-Unsupported operand types: bool / string
-Unsupported operand types: string / bool
-Unsupported operand types: bool / string
-Unsupported operand types: string / int
-Unsupported operand types: int / string
-Unsupported operand types: string / float
-Unsupported operand types: float / string
-Unsupported operand types: string / string
-Unsupported operand types: string / string
-Unsupported operand types: string / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / string
-Unsupported operand types: array % array
-Unsupported operand types: array % stdClass
-Unsupported operand types: array % resource
-Unsupported operand types: array % string
-Unsupported operand types: stdClass % array
-Unsupported operand types: stdClass % stdClass
-Unsupported operand types: stdClass % resource
-Unsupported operand types: stdClass % string
-Unsupported operand types: resource % array
-Unsupported operand types: resource % stdClass
-Unsupported operand types: resource % resource
-Unsupported operand types: resource % string
-Unsupported operand types: string % array
-Unsupported operand types: string % stdClass
-Unsupported operand types: string % resource
-Unsupported operand types: string % string
-Unsupported operand types: array % null
-Unsupported operand types: null % array
-Unsupported operand types: array % bool
-Unsupported operand types: bool % array
-Unsupported operand types: array % bool
-Unsupported operand types: bool % array
-Unsupported operand types: array % int
-Unsupported operand types: int % array
-Unsupported operand types: array % float
+TypeError: Unsupported operand types: array + stdClass
+TypeError: Unsupported operand types: array + resource
+TypeError: Unsupported operand types: array + string
+TypeError: Unsupported operand types: stdClass + array
+TypeError: Unsupported operand types: stdClass + stdClass
+TypeError: Unsupported operand types: stdClass + resource
+TypeError: Unsupported operand types: stdClass + string
+TypeError: Unsupported operand types: resource + array
+TypeError: Unsupported operand types: resource + stdClass
+TypeError: Unsupported operand types: resource + resource
+TypeError: Unsupported operand types: resource + string
+TypeError: Unsupported operand types: string + array
+TypeError: Unsupported operand types: string + stdClass
+TypeError: Unsupported operand types: string + resource
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: array + null
+TypeError: Unsupported operand types: null + array
+TypeError: Unsupported operand types: array + bool
+TypeError: Unsupported operand types: bool + array
+TypeError: Unsupported operand types: array + bool
+TypeError: Unsupported operand types: bool + array
+TypeError: Unsupported operand types: array + int
+TypeError: Unsupported operand types: int + array
+TypeError: Unsupported operand types: array + float
+TypeError: Unsupported operand types: float + array
+TypeError: Unsupported operand types: array + string
+TypeError: Unsupported operand types: string + array
+TypeError: Unsupported operand types: array + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + array
+TypeError: Unsupported operand types: stdClass + null
+TypeError: Unsupported operand types: null + stdClass
+TypeError: Unsupported operand types: stdClass + bool
+TypeError: Unsupported operand types: bool + stdClass
+TypeError: Unsupported operand types: stdClass + bool
+TypeError: Unsupported operand types: bool + stdClass
+TypeError: Unsupported operand types: stdClass + int
+TypeError: Unsupported operand types: int + stdClass
+TypeError: Unsupported operand types: stdClass + float
+TypeError: Unsupported operand types: float + stdClass
+TypeError: Unsupported operand types: stdClass + string
+TypeError: Unsupported operand types: string + stdClass
+TypeError: Unsupported operand types: stdClass + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + stdClass
+TypeError: Unsupported operand types: resource + null
+TypeError: Unsupported operand types: null + resource
+TypeError: Unsupported operand types: resource + bool
+TypeError: Unsupported operand types: bool + resource
+TypeError: Unsupported operand types: resource + bool
+TypeError: Unsupported operand types: bool + resource
+TypeError: Unsupported operand types: resource + int
+TypeError: Unsupported operand types: int + resource
+TypeError: Unsupported operand types: resource + float
+TypeError: Unsupported operand types: float + resource
+TypeError: Unsupported operand types: resource + string
+TypeError: Unsupported operand types: string + resource
+TypeError: Unsupported operand types: resource + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + resource
+TypeError: Unsupported operand types: string + null
+TypeError: Unsupported operand types: null + string
+TypeError: Unsupported operand types: string + bool
+TypeError: Unsupported operand types: bool + string
+TypeError: Unsupported operand types: string + bool
+TypeError: Unsupported operand types: bool + string
+TypeError: Unsupported operand types: string + int
+TypeError: Unsupported operand types: int + string
+TypeError: Unsupported operand types: string + float
+TypeError: Unsupported operand types: float + string
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: string + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: array - array
+TypeError: Unsupported operand types: array - stdClass
+TypeError: Unsupported operand types: array - resource
+TypeError: Unsupported operand types: array - string
+TypeError: Unsupported operand types: stdClass - array
+TypeError: Unsupported operand types: stdClass - stdClass
+TypeError: Unsupported operand types: stdClass - resource
+TypeError: Unsupported operand types: stdClass - string
+TypeError: Unsupported operand types: resource - array
+TypeError: Unsupported operand types: resource - stdClass
+TypeError: Unsupported operand types: resource - resource
+TypeError: Unsupported operand types: resource - string
+TypeError: Unsupported operand types: string - array
+TypeError: Unsupported operand types: string - stdClass
+TypeError: Unsupported operand types: string - resource
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: array - null
+TypeError: Unsupported operand types: null - array
+TypeError: Unsupported operand types: array - bool
+TypeError: Unsupported operand types: bool - array
+TypeError: Unsupported operand types: array - bool
+TypeError: Unsupported operand types: bool - array
+TypeError: Unsupported operand types: array - int
+TypeError: Unsupported operand types: int - array
+TypeError: Unsupported operand types: array - float
+TypeError: Unsupported operand types: float - array
+TypeError: Unsupported operand types: array - string
+TypeError: Unsupported operand types: string - array
+TypeError: Unsupported operand types: array - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - array
+TypeError: Unsupported operand types: stdClass - null
+TypeError: Unsupported operand types: null - stdClass
+TypeError: Unsupported operand types: stdClass - bool
+TypeError: Unsupported operand types: bool - stdClass
+TypeError: Unsupported operand types: stdClass - bool
+TypeError: Unsupported operand types: bool - stdClass
+TypeError: Unsupported operand types: stdClass - int
+TypeError: Unsupported operand types: int - stdClass
+TypeError: Unsupported operand types: stdClass - float
+TypeError: Unsupported operand types: float - stdClass
+TypeError: Unsupported operand types: stdClass - string
+TypeError: Unsupported operand types: string - stdClass
+TypeError: Unsupported operand types: stdClass - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - stdClass
+TypeError: Unsupported operand types: resource - null
+TypeError: Unsupported operand types: null - resource
+TypeError: Unsupported operand types: resource - bool
+TypeError: Unsupported operand types: bool - resource
+TypeError: Unsupported operand types: resource - bool
+TypeError: Unsupported operand types: bool - resource
+TypeError: Unsupported operand types: resource - int
+TypeError: Unsupported operand types: int - resource
+TypeError: Unsupported operand types: resource - float
+TypeError: Unsupported operand types: float - resource
+TypeError: Unsupported operand types: resource - string
+TypeError: Unsupported operand types: string - resource
+TypeError: Unsupported operand types: resource - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - resource
+TypeError: Unsupported operand types: string - null
+TypeError: Unsupported operand types: null - string
+TypeError: Unsupported operand types: string - bool
+TypeError: Unsupported operand types: bool - string
+TypeError: Unsupported operand types: string - bool
+TypeError: Unsupported operand types: bool - string
+TypeError: Unsupported operand types: string - int
+TypeError: Unsupported operand types: int - string
+TypeError: Unsupported operand types: string - float
+TypeError: Unsupported operand types: float - string
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: string - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: array * array
+TypeError: Unsupported operand types: stdClass * array
+TypeError: Unsupported operand types: resource * array
+TypeError: Unsupported operand types: array * string
+TypeError: Unsupported operand types: stdClass * array
+TypeError: Unsupported operand types: stdClass * stdClass
+TypeError: Unsupported operand types: stdClass * resource
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: resource * array
+TypeError: Unsupported operand types: resource * stdClass
+TypeError: Unsupported operand types: resource * resource
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: string * array
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: array * null
+TypeError: Unsupported operand types: null * array
+TypeError: Unsupported operand types: array * bool
+TypeError: Unsupported operand types: bool * array
+TypeError: Unsupported operand types: array * bool
+TypeError: Unsupported operand types: bool * array
+TypeError: Unsupported operand types: array * int
+TypeError: Unsupported operand types: int * array
+TypeError: Unsupported operand types: array * float
+TypeError: Unsupported operand types: float * array
+TypeError: Unsupported operand types: array * string
+TypeError: Unsupported operand types: string * array
+TypeError: Unsupported operand types: array * string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string * array
+TypeError: Unsupported operand types: stdClass * null
+TypeError: Unsupported operand types: stdClass * null
+TypeError: Unsupported operand types: stdClass * bool
+TypeError: Unsupported operand types: stdClass * bool
+TypeError: Unsupported operand types: stdClass * bool
+TypeError: Unsupported operand types: stdClass * bool
+TypeError: Unsupported operand types: stdClass * int
+TypeError: Unsupported operand types: stdClass * int
+TypeError: Unsupported operand types: stdClass * float
+TypeError: Unsupported operand types: stdClass * float
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: resource * null
+TypeError: Unsupported operand types: resource * null
+TypeError: Unsupported operand types: resource * bool
+TypeError: Unsupported operand types: resource * bool
+TypeError: Unsupported operand types: resource * bool
+TypeError: Unsupported operand types: resource * bool
+TypeError: Unsupported operand types: resource * int
+TypeError: Unsupported operand types: resource * int
+TypeError: Unsupported operand types: resource * float
+TypeError: Unsupported operand types: resource * float
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: string * null
+TypeError: Unsupported operand types: null * string
+TypeError: Unsupported operand types: string * bool
+TypeError: Unsupported operand types: bool * string
+TypeError: Unsupported operand types: string * bool
+TypeError: Unsupported operand types: bool * string
+TypeError: Unsupported operand types: string * int
+TypeError: Unsupported operand types: int * string
+TypeError: Unsupported operand types: string * float
+TypeError: Unsupported operand types: float * string
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: array / array
+TypeError: Unsupported operand types: array / stdClass
+TypeError: Unsupported operand types: array / resource
+TypeError: Unsupported operand types: array / string
+TypeError: Unsupported operand types: stdClass / array
+TypeError: Unsupported operand types: stdClass / stdClass
+TypeError: Unsupported operand types: stdClass / resource
+TypeError: Unsupported operand types: stdClass / string
+TypeError: Unsupported operand types: resource / array
+TypeError: Unsupported operand types: resource / stdClass
+TypeError: Unsupported operand types: resource / resource
+TypeError: Unsupported operand types: resource / string
+TypeError: Unsupported operand types: string / array
+TypeError: Unsupported operand types: string / stdClass
+TypeError: Unsupported operand types: string / resource
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: array / null
+TypeError: Unsupported operand types: null / array
+TypeError: Unsupported operand types: array / bool
+TypeError: Unsupported operand types: bool / array
+TypeError: Unsupported operand types: array / bool
+TypeError: Unsupported operand types: bool / array
+TypeError: Unsupported operand types: array / int
+TypeError: Unsupported operand types: int / array
+TypeError: Unsupported operand types: array / float
+TypeError: Unsupported operand types: float / array
+TypeError: Unsupported operand types: array / string
+TypeError: Unsupported operand types: string / array
+TypeError: Unsupported operand types: array / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / array
+TypeError: Unsupported operand types: stdClass / null
+TypeError: Unsupported operand types: null / stdClass
+TypeError: Unsupported operand types: stdClass / bool
+TypeError: Unsupported operand types: bool / stdClass
+TypeError: Unsupported operand types: stdClass / bool
+TypeError: Unsupported operand types: bool / stdClass
+TypeError: Unsupported operand types: stdClass / int
+TypeError: Unsupported operand types: int / stdClass
+TypeError: Unsupported operand types: stdClass / float
+TypeError: Unsupported operand types: float / stdClass
+TypeError: Unsupported operand types: stdClass / string
+TypeError: Unsupported operand types: string / stdClass
+TypeError: Unsupported operand types: stdClass / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / stdClass
+TypeError: Unsupported operand types: resource / null
+TypeError: Unsupported operand types: null / resource
+TypeError: Unsupported operand types: resource / bool
+TypeError: Unsupported operand types: bool / resource
+TypeError: Unsupported operand types: resource / bool
+TypeError: Unsupported operand types: bool / resource
+TypeError: Unsupported operand types: resource / int
+TypeError: Unsupported operand types: int / resource
+TypeError: Unsupported operand types: resource / float
+TypeError: Unsupported operand types: float / resource
+TypeError: Unsupported operand types: resource / string
+TypeError: Unsupported operand types: string / resource
+TypeError: Unsupported operand types: resource / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / resource
+TypeError: Unsupported operand types: string / null
+TypeError: Unsupported operand types: null / string
+TypeError: Unsupported operand types: string / bool
+TypeError: Unsupported operand types: bool / string
+TypeError: Unsupported operand types: string / bool
+TypeError: Unsupported operand types: bool / string
+TypeError: Unsupported operand types: string / int
+TypeError: Unsupported operand types: int / string
+TypeError: Unsupported operand types: string / float
+TypeError: Unsupported operand types: float / string
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: array % array
+TypeError: Unsupported operand types: array % stdClass
+TypeError: Unsupported operand types: array % resource
+TypeError: Unsupported operand types: array % string
+TypeError: Unsupported operand types: stdClass % array
+TypeError: Unsupported operand types: stdClass % stdClass
+TypeError: Unsupported operand types: stdClass % resource
+TypeError: Unsupported operand types: stdClass % string
+TypeError: Unsupported operand types: resource % array
+TypeError: Unsupported operand types: resource % stdClass
+TypeError: Unsupported operand types: resource % resource
+TypeError: Unsupported operand types: resource % string
+TypeError: Unsupported operand types: string % array
+TypeError: Unsupported operand types: string % stdClass
+TypeError: Unsupported operand types: string % resource
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: array % null
+TypeError: Unsupported operand types: null % array
+TypeError: Unsupported operand types: array % bool
+TypeError: Unsupported operand types: bool % array
+TypeError: Unsupported operand types: array % bool
+TypeError: Unsupported operand types: bool % array
+TypeError: Unsupported operand types: array % int
+TypeError: Unsupported operand types: int % array
+TypeError: Unsupported operand types: array % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % array
-Unsupported operand types: array % string
-Unsupported operand types: string % array
-Unsupported operand types: array % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % array
-Unsupported operand types: stdClass % null
-Unsupported operand types: null % stdClass
-Unsupported operand types: stdClass % bool
-Unsupported operand types: bool % stdClass
-Unsupported operand types: stdClass % bool
-Unsupported operand types: bool % stdClass
-Unsupported operand types: stdClass % int
-Unsupported operand types: int % stdClass
-Unsupported operand types: stdClass % float
+TypeError: Unsupported operand types: float % array
+TypeError: Unsupported operand types: array % string
+TypeError: Unsupported operand types: string % array
+TypeError: Unsupported operand types: array % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % array
+TypeError: Unsupported operand types: stdClass % null
+TypeError: Unsupported operand types: null % stdClass
+TypeError: Unsupported operand types: stdClass % bool
+TypeError: Unsupported operand types: bool % stdClass
+TypeError: Unsupported operand types: stdClass % bool
+TypeError: Unsupported operand types: bool % stdClass
+TypeError: Unsupported operand types: stdClass % int
+TypeError: Unsupported operand types: int % stdClass
+TypeError: Unsupported operand types: stdClass % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % stdClass
-Unsupported operand types: stdClass % string
-Unsupported operand types: string % stdClass
-Unsupported operand types: stdClass % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % stdClass
-Unsupported operand types: resource % null
-Unsupported operand types: null % resource
-Unsupported operand types: resource % bool
-Unsupported operand types: bool % resource
-Unsupported operand types: resource % bool
-Unsupported operand types: bool % resource
-Unsupported operand types: resource % int
-Unsupported operand types: int % resource
-Unsupported operand types: resource % float
+TypeError: Unsupported operand types: float % stdClass
+TypeError: Unsupported operand types: stdClass % string
+TypeError: Unsupported operand types: string % stdClass
+TypeError: Unsupported operand types: stdClass % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % stdClass
+TypeError: Unsupported operand types: resource % null
+TypeError: Unsupported operand types: null % resource
+TypeError: Unsupported operand types: resource % bool
+TypeError: Unsupported operand types: bool % resource
+TypeError: Unsupported operand types: resource % bool
+TypeError: Unsupported operand types: bool % resource
+TypeError: Unsupported operand types: resource % int
+TypeError: Unsupported operand types: int % resource
+TypeError: Unsupported operand types: resource % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % resource
-Unsupported operand types: resource % string
-Unsupported operand types: string % resource
-Unsupported operand types: resource % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % resource
-Unsupported operand types: string % null
-Unsupported operand types: null % string
-Unsupported operand types: string % bool
-Unsupported operand types: bool % string
-Unsupported operand types: string % bool
-Unsupported operand types: bool % string
-Unsupported operand types: string % int
-Unsupported operand types: int % string
-Unsupported operand types: string % float
+TypeError: Unsupported operand types: float % resource
+TypeError: Unsupported operand types: resource % string
+TypeError: Unsupported operand types: string % resource
+TypeError: Unsupported operand types: resource % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % resource
+TypeError: Unsupported operand types: string % null
+TypeError: Unsupported operand types: null % string
+TypeError: Unsupported operand types: string % bool
+TypeError: Unsupported operand types: bool % string
+TypeError: Unsupported operand types: string % bool
+TypeError: Unsupported operand types: bool % string
+TypeError: Unsupported operand types: string % int
+TypeError: Unsupported operand types: int % string
+TypeError: Unsupported operand types: string % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % string
-Unsupported operand types: string % string
-Unsupported operand types: string % string
-Unsupported operand types: string % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % string
-Unsupported operand types: array ** array
-Unsupported operand types: array ** stdClass
-Unsupported operand types: array ** resource
-Unsupported operand types: array ** string
-Unsupported operand types: stdClass ** array
-Unsupported operand types: stdClass ** stdClass
-Unsupported operand types: stdClass ** resource
-Unsupported operand types: stdClass ** string
-Unsupported operand types: resource ** array
-Unsupported operand types: resource ** stdClass
-Unsupported operand types: resource ** resource
-Unsupported operand types: resource ** string
-Unsupported operand types: string ** array
-Unsupported operand types: string ** stdClass
-Unsupported operand types: string ** resource
-Unsupported operand types: string ** string
-Unsupported operand types: array ** null
-Unsupported operand types: null ** array
-Unsupported operand types: array ** bool
-Unsupported operand types: bool ** array
-Unsupported operand types: array ** bool
-Unsupported operand types: bool ** array
-Unsupported operand types: array ** int
-Unsupported operand types: int ** array
-Unsupported operand types: array ** float
-Unsupported operand types: float ** array
-Unsupported operand types: array ** string
-Unsupported operand types: string ** array
-Unsupported operand types: array ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** array
-Unsupported operand types: stdClass ** null
-Unsupported operand types: null ** stdClass
-Unsupported operand types: stdClass ** bool
-Unsupported operand types: bool ** stdClass
-Unsupported operand types: stdClass ** bool
-Unsupported operand types: bool ** stdClass
-Unsupported operand types: stdClass ** int
-Unsupported operand types: int ** stdClass
-Unsupported operand types: stdClass ** float
-Unsupported operand types: float ** stdClass
-Unsupported operand types: stdClass ** string
-Unsupported operand types: string ** stdClass
-Unsupported operand types: stdClass ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** stdClass
-Unsupported operand types: resource ** null
-Unsupported operand types: null ** resource
-Unsupported operand types: resource ** bool
-Unsupported operand types: bool ** resource
-Unsupported operand types: resource ** bool
-Unsupported operand types: bool ** resource
-Unsupported operand types: resource ** int
-Unsupported operand types: int ** resource
-Unsupported operand types: resource ** float
-Unsupported operand types: float ** resource
-Unsupported operand types: resource ** string
-Unsupported operand types: string ** resource
-Unsupported operand types: resource ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** resource
-Unsupported operand types: string ** null
-Unsupported operand types: null ** string
-Unsupported operand types: string ** bool
-Unsupported operand types: bool ** string
-Unsupported operand types: string ** bool
-Unsupported operand types: bool ** string
-Unsupported operand types: string ** int
-Unsupported operand types: int ** string
-Unsupported operand types: string ** float
-Unsupported operand types: float ** string
-Unsupported operand types: string ** string
-Unsupported operand types: string ** string
-Unsupported operand types: string ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** string
-Unsupported operand types: array << array
-Unsupported operand types: array << stdClass
-Unsupported operand types: array << resource
-Unsupported operand types: array << string
-Unsupported operand types: stdClass << array
-Unsupported operand types: stdClass << stdClass
-Unsupported operand types: stdClass << resource
-Unsupported operand types: stdClass << string
-Unsupported operand types: resource << array
-Unsupported operand types: resource << stdClass
-Unsupported operand types: resource << resource
-Unsupported operand types: resource << string
-Unsupported operand types: string << array
-Unsupported operand types: string << stdClass
-Unsupported operand types: string << resource
-Unsupported operand types: string << string
-Unsupported operand types: array << null
-Unsupported operand types: null << array
-Unsupported operand types: array << bool
-Unsupported operand types: bool << array
-Unsupported operand types: array << bool
-Unsupported operand types: bool << array
-Unsupported operand types: array << int
-Unsupported operand types: int << array
-Unsupported operand types: array << float
+TypeError: Unsupported operand types: float % string
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: string % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: array ** array
+TypeError: Unsupported operand types: array ** stdClass
+TypeError: Unsupported operand types: array ** resource
+TypeError: Unsupported operand types: array ** string
+TypeError: Unsupported operand types: stdClass ** array
+TypeError: Unsupported operand types: stdClass ** stdClass
+TypeError: Unsupported operand types: stdClass ** resource
+TypeError: Unsupported operand types: stdClass ** string
+TypeError: Unsupported operand types: resource ** array
+TypeError: Unsupported operand types: resource ** stdClass
+TypeError: Unsupported operand types: resource ** resource
+TypeError: Unsupported operand types: resource ** string
+TypeError: Unsupported operand types: string ** array
+TypeError: Unsupported operand types: string ** stdClass
+TypeError: Unsupported operand types: string ** resource
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: array ** null
+TypeError: Unsupported operand types: null ** array
+TypeError: Unsupported operand types: array ** bool
+TypeError: Unsupported operand types: bool ** array
+TypeError: Unsupported operand types: array ** bool
+TypeError: Unsupported operand types: bool ** array
+TypeError: Unsupported operand types: array ** int
+TypeError: Unsupported operand types: int ** array
+TypeError: Unsupported operand types: array ** float
+TypeError: Unsupported operand types: float ** array
+TypeError: Unsupported operand types: array ** string
+TypeError: Unsupported operand types: string ** array
+TypeError: Unsupported operand types: array ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** array
+TypeError: Unsupported operand types: stdClass ** null
+TypeError: Unsupported operand types: null ** stdClass
+TypeError: Unsupported operand types: stdClass ** bool
+TypeError: Unsupported operand types: bool ** stdClass
+TypeError: Unsupported operand types: stdClass ** bool
+TypeError: Unsupported operand types: bool ** stdClass
+TypeError: Unsupported operand types: stdClass ** int
+TypeError: Unsupported operand types: int ** stdClass
+TypeError: Unsupported operand types: stdClass ** float
+TypeError: Unsupported operand types: float ** stdClass
+TypeError: Unsupported operand types: stdClass ** string
+TypeError: Unsupported operand types: string ** stdClass
+TypeError: Unsupported operand types: stdClass ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** stdClass
+TypeError: Unsupported operand types: resource ** null
+TypeError: Unsupported operand types: null ** resource
+TypeError: Unsupported operand types: resource ** bool
+TypeError: Unsupported operand types: bool ** resource
+TypeError: Unsupported operand types: resource ** bool
+TypeError: Unsupported operand types: bool ** resource
+TypeError: Unsupported operand types: resource ** int
+TypeError: Unsupported operand types: int ** resource
+TypeError: Unsupported operand types: resource ** float
+TypeError: Unsupported operand types: float ** resource
+TypeError: Unsupported operand types: resource ** string
+TypeError: Unsupported operand types: string ** resource
+TypeError: Unsupported operand types: resource ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** resource
+TypeError: Unsupported operand types: string ** null
+TypeError: Unsupported operand types: null ** string
+TypeError: Unsupported operand types: string ** bool
+TypeError: Unsupported operand types: bool ** string
+TypeError: Unsupported operand types: string ** bool
+TypeError: Unsupported operand types: bool ** string
+TypeError: Unsupported operand types: string ** int
+TypeError: Unsupported operand types: int ** string
+TypeError: Unsupported operand types: string ** float
+TypeError: Unsupported operand types: float ** string
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: array << array
+TypeError: Unsupported operand types: array << stdClass
+TypeError: Unsupported operand types: array << resource
+TypeError: Unsupported operand types: array << string
+TypeError: Unsupported operand types: stdClass << array
+TypeError: Unsupported operand types: stdClass << stdClass
+TypeError: Unsupported operand types: stdClass << resource
+TypeError: Unsupported operand types: stdClass << string
+TypeError: Unsupported operand types: resource << array
+TypeError: Unsupported operand types: resource << stdClass
+TypeError: Unsupported operand types: resource << resource
+TypeError: Unsupported operand types: resource << string
+TypeError: Unsupported operand types: string << array
+TypeError: Unsupported operand types: string << stdClass
+TypeError: Unsupported operand types: string << resource
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: array << null
+TypeError: Unsupported operand types: null << array
+TypeError: Unsupported operand types: array << bool
+TypeError: Unsupported operand types: bool << array
+TypeError: Unsupported operand types: array << bool
+TypeError: Unsupported operand types: bool << array
+TypeError: Unsupported operand types: array << int
+TypeError: Unsupported operand types: int << array
+TypeError: Unsupported operand types: array << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << array
-Unsupported operand types: array << string
-Unsupported operand types: string << array
-Unsupported operand types: array << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << array
-Unsupported operand types: stdClass << null
-Unsupported operand types: null << stdClass
-Unsupported operand types: stdClass << bool
-Unsupported operand types: bool << stdClass
-Unsupported operand types: stdClass << bool
-Unsupported operand types: bool << stdClass
-Unsupported operand types: stdClass << int
-Unsupported operand types: int << stdClass
-Unsupported operand types: stdClass << float
+TypeError: Unsupported operand types: float << array
+TypeError: Unsupported operand types: array << string
+TypeError: Unsupported operand types: string << array
+TypeError: Unsupported operand types: array << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << array
+TypeError: Unsupported operand types: stdClass << null
+TypeError: Unsupported operand types: null << stdClass
+TypeError: Unsupported operand types: stdClass << bool
+TypeError: Unsupported operand types: bool << stdClass
+TypeError: Unsupported operand types: stdClass << bool
+TypeError: Unsupported operand types: bool << stdClass
+TypeError: Unsupported operand types: stdClass << int
+TypeError: Unsupported operand types: int << stdClass
+TypeError: Unsupported operand types: stdClass << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << stdClass
-Unsupported operand types: stdClass << string
-Unsupported operand types: string << stdClass
-Unsupported operand types: stdClass << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << stdClass
-Unsupported operand types: resource << null
-Unsupported operand types: null << resource
-Unsupported operand types: resource << bool
-Unsupported operand types: bool << resource
-Unsupported operand types: resource << bool
-Unsupported operand types: bool << resource
-Unsupported operand types: resource << int
-Unsupported operand types: int << resource
-Unsupported operand types: resource << float
+TypeError: Unsupported operand types: float << stdClass
+TypeError: Unsupported operand types: stdClass << string
+TypeError: Unsupported operand types: string << stdClass
+TypeError: Unsupported operand types: stdClass << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << stdClass
+TypeError: Unsupported operand types: resource << null
+TypeError: Unsupported operand types: null << resource
+TypeError: Unsupported operand types: resource << bool
+TypeError: Unsupported operand types: bool << resource
+TypeError: Unsupported operand types: resource << bool
+TypeError: Unsupported operand types: bool << resource
+TypeError: Unsupported operand types: resource << int
+TypeError: Unsupported operand types: int << resource
+TypeError: Unsupported operand types: resource << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << resource
-Unsupported operand types: resource << string
-Unsupported operand types: string << resource
-Unsupported operand types: resource << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << resource
-Unsupported operand types: string << null
-Unsupported operand types: null << string
-Unsupported operand types: string << bool
-Unsupported operand types: bool << string
-Unsupported operand types: string << bool
-Unsupported operand types: bool << string
-Unsupported operand types: string << int
-Unsupported operand types: int << string
-Unsupported operand types: string << float
+TypeError: Unsupported operand types: float << resource
+TypeError: Unsupported operand types: resource << string
+TypeError: Unsupported operand types: string << resource
+TypeError: Unsupported operand types: resource << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << resource
+TypeError: Unsupported operand types: string << null
+TypeError: Unsupported operand types: null << string
+TypeError: Unsupported operand types: string << bool
+TypeError: Unsupported operand types: bool << string
+TypeError: Unsupported operand types: string << bool
+TypeError: Unsupported operand types: bool << string
+TypeError: Unsupported operand types: string << int
+TypeError: Unsupported operand types: int << string
+TypeError: Unsupported operand types: string << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << string
-Unsupported operand types: string << string
-Unsupported operand types: string << string
-Unsupported operand types: string << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << string
-Unsupported operand types: array >> array
-Unsupported operand types: array >> stdClass
-Unsupported operand types: array >> resource
-Unsupported operand types: array >> string
-Unsupported operand types: stdClass >> array
-Unsupported operand types: stdClass >> stdClass
-Unsupported operand types: stdClass >> resource
-Unsupported operand types: stdClass >> string
-Unsupported operand types: resource >> array
-Unsupported operand types: resource >> stdClass
-Unsupported operand types: resource >> resource
-Unsupported operand types: resource >> string
-Unsupported operand types: string >> array
-Unsupported operand types: string >> stdClass
-Unsupported operand types: string >> resource
-Unsupported operand types: string >> string
-Unsupported operand types: array >> null
-Unsupported operand types: null >> array
-Unsupported operand types: array >> bool
-Unsupported operand types: bool >> array
-Unsupported operand types: array >> bool
-Unsupported operand types: bool >> array
-Unsupported operand types: array >> int
-Unsupported operand types: int >> array
-Unsupported operand types: array >> float
+TypeError: Unsupported operand types: float << string
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: array >> array
+TypeError: Unsupported operand types: array >> stdClass
+TypeError: Unsupported operand types: array >> resource
+TypeError: Unsupported operand types: array >> string
+TypeError: Unsupported operand types: stdClass >> array
+TypeError: Unsupported operand types: stdClass >> stdClass
+TypeError: Unsupported operand types: stdClass >> resource
+TypeError: Unsupported operand types: stdClass >> string
+TypeError: Unsupported operand types: resource >> array
+TypeError: Unsupported operand types: resource >> stdClass
+TypeError: Unsupported operand types: resource >> resource
+TypeError: Unsupported operand types: resource >> string
+TypeError: Unsupported operand types: string >> array
+TypeError: Unsupported operand types: string >> stdClass
+TypeError: Unsupported operand types: string >> resource
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: array >> null
+TypeError: Unsupported operand types: null >> array
+TypeError: Unsupported operand types: array >> bool
+TypeError: Unsupported operand types: bool >> array
+TypeError: Unsupported operand types: array >> bool
+TypeError: Unsupported operand types: bool >> array
+TypeError: Unsupported operand types: array >> int
+TypeError: Unsupported operand types: int >> array
+TypeError: Unsupported operand types: array >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> array
-Unsupported operand types: array >> string
-Unsupported operand types: string >> array
-Unsupported operand types: array >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> array
-Unsupported operand types: stdClass >> null
-Unsupported operand types: null >> stdClass
-Unsupported operand types: stdClass >> bool
-Unsupported operand types: bool >> stdClass
-Unsupported operand types: stdClass >> bool
-Unsupported operand types: bool >> stdClass
-Unsupported operand types: stdClass >> int
-Unsupported operand types: int >> stdClass
-Unsupported operand types: stdClass >> float
+TypeError: Unsupported operand types: float >> array
+TypeError: Unsupported operand types: array >> string
+TypeError: Unsupported operand types: string >> array
+TypeError: Unsupported operand types: array >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> array
+TypeError: Unsupported operand types: stdClass >> null
+TypeError: Unsupported operand types: null >> stdClass
+TypeError: Unsupported operand types: stdClass >> bool
+TypeError: Unsupported operand types: bool >> stdClass
+TypeError: Unsupported operand types: stdClass >> bool
+TypeError: Unsupported operand types: bool >> stdClass
+TypeError: Unsupported operand types: stdClass >> int
+TypeError: Unsupported operand types: int >> stdClass
+TypeError: Unsupported operand types: stdClass >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> stdClass
-Unsupported operand types: stdClass >> string
-Unsupported operand types: string >> stdClass
-Unsupported operand types: stdClass >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> stdClass
-Unsupported operand types: resource >> null
-Unsupported operand types: null >> resource
-Unsupported operand types: resource >> bool
-Unsupported operand types: bool >> resource
-Unsupported operand types: resource >> bool
-Unsupported operand types: bool >> resource
-Unsupported operand types: resource >> int
-Unsupported operand types: int >> resource
-Unsupported operand types: resource >> float
+TypeError: Unsupported operand types: float >> stdClass
+TypeError: Unsupported operand types: stdClass >> string
+TypeError: Unsupported operand types: string >> stdClass
+TypeError: Unsupported operand types: stdClass >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> stdClass
+TypeError: Unsupported operand types: resource >> null
+TypeError: Unsupported operand types: null >> resource
+TypeError: Unsupported operand types: resource >> bool
+TypeError: Unsupported operand types: bool >> resource
+TypeError: Unsupported operand types: resource >> bool
+TypeError: Unsupported operand types: bool >> resource
+TypeError: Unsupported operand types: resource >> int
+TypeError: Unsupported operand types: int >> resource
+TypeError: Unsupported operand types: resource >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> resource
-Unsupported operand types: resource >> string
-Unsupported operand types: string >> resource
-Unsupported operand types: resource >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> resource
-Unsupported operand types: string >> null
-Unsupported operand types: null >> string
-Unsupported operand types: string >> bool
-Unsupported operand types: bool >> string
-Unsupported operand types: string >> bool
-Unsupported operand types: bool >> string
-Unsupported operand types: string >> int
-Unsupported operand types: int >> string
-Unsupported operand types: string >> float
+TypeError: Unsupported operand types: float >> resource
+TypeError: Unsupported operand types: resource >> string
+TypeError: Unsupported operand types: string >> resource
+TypeError: Unsupported operand types: resource >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> resource
+TypeError: Unsupported operand types: string >> null
+TypeError: Unsupported operand types: null >> string
+TypeError: Unsupported operand types: string >> bool
+TypeError: Unsupported operand types: bool >> string
+TypeError: Unsupported operand types: string >> bool
+TypeError: Unsupported operand types: bool >> string
+TypeError: Unsupported operand types: string >> int
+TypeError: Unsupported operand types: int >> string
+TypeError: Unsupported operand types: string >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> string
-Unsupported operand types: string >> string
-Unsupported operand types: string >> string
-Unsupported operand types: string >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> string
-Unsupported operand types: array & array
-Unsupported operand types: stdClass & array
-Unsupported operand types: resource & array
-Unsupported operand types: array & string
-Unsupported operand types: stdClass & array
-Unsupported operand types: stdClass & stdClass
-Unsupported operand types: stdClass & resource
-Unsupported operand types: stdClass & string
-Unsupported operand types: resource & array
-Unsupported operand types: resource & stdClass
-Unsupported operand types: resource & resource
-Unsupported operand types: resource & string
-Unsupported operand types: string & array
-Unsupported operand types: stdClass & string
-Unsupported operand types: resource & string
+TypeError: Unsupported operand types: float >> string
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: array & array
+TypeError: Unsupported operand types: stdClass & array
+TypeError: Unsupported operand types: resource & array
+TypeError: Unsupported operand types: array & string
+TypeError: Unsupported operand types: stdClass & array
+TypeError: Unsupported operand types: stdClass & stdClass
+TypeError: Unsupported operand types: stdClass & resource
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: resource & array
+TypeError: Unsupported operand types: resource & stdClass
+TypeError: Unsupported operand types: resource & resource
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: string & array
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: resource & string
No error for "foo" & "foo"
-Unsupported operand types: array & null
-Unsupported operand types: null & array
-Unsupported operand types: array & bool
-Unsupported operand types: bool & array
-Unsupported operand types: array & bool
-Unsupported operand types: bool & array
-Unsupported operand types: array & int
-Unsupported operand types: int & array
-Unsupported operand types: array & float
+TypeError: Unsupported operand types: array & null
+TypeError: Unsupported operand types: null & array
+TypeError: Unsupported operand types: array & bool
+TypeError: Unsupported operand types: bool & array
+TypeError: Unsupported operand types: array & bool
+TypeError: Unsupported operand types: bool & array
+TypeError: Unsupported operand types: array & int
+TypeError: Unsupported operand types: int & array
+TypeError: Unsupported operand types: array & float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float & array
-Unsupported operand types: array & string
-Unsupported operand types: string & array
-Unsupported operand types: array & string
-Warning: A non-numeric value encountered
-Unsupported operand types: string & array
-Unsupported operand types: stdClass & null
-Unsupported operand types: stdClass & null
-Unsupported operand types: stdClass & bool
-Unsupported operand types: stdClass & bool
-Unsupported operand types: stdClass & bool
-Unsupported operand types: stdClass & bool
-Unsupported operand types: stdClass & int
-Unsupported operand types: stdClass & int
-Unsupported operand types: stdClass & float
-Unsupported operand types: stdClass & float
-Unsupported operand types: stdClass & string
-Unsupported operand types: stdClass & string
-Unsupported operand types: stdClass & string
-Unsupported operand types: stdClass & string
-Unsupported operand types: resource & null
-Unsupported operand types: resource & null
-Unsupported operand types: resource & bool
-Unsupported operand types: resource & bool
-Unsupported operand types: resource & bool
-Unsupported operand types: resource & bool
-Unsupported operand types: resource & int
-Unsupported operand types: resource & int
-Unsupported operand types: resource & float
-Unsupported operand types: resource & float
-Unsupported operand types: resource & string
-Unsupported operand types: resource & string
-Unsupported operand types: resource & string
-Unsupported operand types: resource & string
-Unsupported operand types: string & null
-Unsupported operand types: null & string
-Unsupported operand types: string & bool
-Unsupported operand types: bool & string
-Unsupported operand types: string & bool
-Unsupported operand types: bool & string
-Unsupported operand types: string & int
-Unsupported operand types: int & string
-Unsupported operand types: string & float
+TypeError: Unsupported operand types: float & array
+TypeError: Unsupported operand types: array & string
+TypeError: Unsupported operand types: string & array
+TypeError: Unsupported operand types: array & string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string & array
+TypeError: Unsupported operand types: stdClass & null
+TypeError: Unsupported operand types: stdClass & null
+TypeError: Unsupported operand types: stdClass & bool
+TypeError: Unsupported operand types: stdClass & bool
+TypeError: Unsupported operand types: stdClass & bool
+TypeError: Unsupported operand types: stdClass & bool
+TypeError: Unsupported operand types: stdClass & int
+TypeError: Unsupported operand types: stdClass & int
+TypeError: Unsupported operand types: stdClass & float
+TypeError: Unsupported operand types: stdClass & float
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: resource & null
+TypeError: Unsupported operand types: resource & null
+TypeError: Unsupported operand types: resource & bool
+TypeError: Unsupported operand types: resource & bool
+TypeError: Unsupported operand types: resource & bool
+TypeError: Unsupported operand types: resource & bool
+TypeError: Unsupported operand types: resource & int
+TypeError: Unsupported operand types: resource & int
+TypeError: Unsupported operand types: resource & float
+TypeError: Unsupported operand types: resource & float
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: string & null
+TypeError: Unsupported operand types: null & string
+TypeError: Unsupported operand types: string & bool
+TypeError: Unsupported operand types: bool & string
+TypeError: Unsupported operand types: string & bool
+TypeError: Unsupported operand types: bool & string
+TypeError: Unsupported operand types: string & int
+TypeError: Unsupported operand types: int & string
+TypeError: Unsupported operand types: string & float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float & string
+TypeError: Unsupported operand types: float & string
No error for "foo" & "123"
No error for "123" & "foo"
No error for "foo" & "123foo"
No error for "123foo" & "foo"
-Unsupported operand types: array | array
-Unsupported operand types: stdClass | array
-Unsupported operand types: resource | array
-Unsupported operand types: array | string
-Unsupported operand types: stdClass | array
-Unsupported operand types: stdClass | stdClass
-Unsupported operand types: stdClass | resource
-Unsupported operand types: stdClass | string
-Unsupported operand types: resource | array
-Unsupported operand types: resource | stdClass
-Unsupported operand types: resource | resource
-Unsupported operand types: resource | string
-Unsupported operand types: string | array
-Unsupported operand types: stdClass | string
-Unsupported operand types: resource | string
+TypeError: Unsupported operand types: array | array
+TypeError: Unsupported operand types: stdClass | array
+TypeError: Unsupported operand types: resource | array
+TypeError: Unsupported operand types: array | string
+TypeError: Unsupported operand types: stdClass | array
+TypeError: Unsupported operand types: stdClass | stdClass
+TypeError: Unsupported operand types: stdClass | resource
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: resource | array
+TypeError: Unsupported operand types: resource | stdClass
+TypeError: Unsupported operand types: resource | resource
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: string | array
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: resource | string
No error for "foo" | "foo"
-Unsupported operand types: array | null
-Unsupported operand types: null | array
-Unsupported operand types: array | bool
-Unsupported operand types: bool | array
-Unsupported operand types: array | bool
-Unsupported operand types: bool | array
-Unsupported operand types: array | int
-Unsupported operand types: int | array
-Unsupported operand types: array | float
+TypeError: Unsupported operand types: array | null
+TypeError: Unsupported operand types: null | array
+TypeError: Unsupported operand types: array | bool
+TypeError: Unsupported operand types: bool | array
+TypeError: Unsupported operand types: array | bool
+TypeError: Unsupported operand types: bool | array
+TypeError: Unsupported operand types: array | int
+TypeError: Unsupported operand types: int | array
+TypeError: Unsupported operand types: array | float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float | array
-Unsupported operand types: array | string
-Unsupported operand types: string | array
-Unsupported operand types: array | string
-Warning: A non-numeric value encountered
-Unsupported operand types: string | array
-Unsupported operand types: stdClass | null
-Unsupported operand types: stdClass | null
-Unsupported operand types: stdClass | bool
-Unsupported operand types: stdClass | bool
-Unsupported operand types: stdClass | bool
-Unsupported operand types: stdClass | bool
-Unsupported operand types: stdClass | int
-Unsupported operand types: stdClass | int
-Unsupported operand types: stdClass | float
-Unsupported operand types: stdClass | float
-Unsupported operand types: stdClass | string
-Unsupported operand types: stdClass | string
-Unsupported operand types: stdClass | string
-Unsupported operand types: stdClass | string
-Unsupported operand types: resource | null
-Unsupported operand types: resource | null
-Unsupported operand types: resource | bool
-Unsupported operand types: resource | bool
-Unsupported operand types: resource | bool
-Unsupported operand types: resource | bool
-Unsupported operand types: resource | int
-Unsupported operand types: resource | int
-Unsupported operand types: resource | float
-Unsupported operand types: resource | float
-Unsupported operand types: resource | string
-Unsupported operand types: resource | string
-Unsupported operand types: resource | string
-Unsupported operand types: resource | string
-Unsupported operand types: string | null
-Unsupported operand types: null | string
-Unsupported operand types: string | bool
-Unsupported operand types: bool | string
-Unsupported operand types: string | bool
-Unsupported operand types: bool | string
-Unsupported operand types: string | int
-Unsupported operand types: int | string
-Unsupported operand types: string | float
+TypeError: Unsupported operand types: float | array
+TypeError: Unsupported operand types: array | string
+TypeError: Unsupported operand types: string | array
+TypeError: Unsupported operand types: array | string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string | array
+TypeError: Unsupported operand types: stdClass | null
+TypeError: Unsupported operand types: stdClass | null
+TypeError: Unsupported operand types: stdClass | bool
+TypeError: Unsupported operand types: stdClass | bool
+TypeError: Unsupported operand types: stdClass | bool
+TypeError: Unsupported operand types: stdClass | bool
+TypeError: Unsupported operand types: stdClass | int
+TypeError: Unsupported operand types: stdClass | int
+TypeError: Unsupported operand types: stdClass | float
+TypeError: Unsupported operand types: stdClass | float
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: resource | null
+TypeError: Unsupported operand types: resource | null
+TypeError: Unsupported operand types: resource | bool
+TypeError: Unsupported operand types: resource | bool
+TypeError: Unsupported operand types: resource | bool
+TypeError: Unsupported operand types: resource | bool
+TypeError: Unsupported operand types: resource | int
+TypeError: Unsupported operand types: resource | int
+TypeError: Unsupported operand types: resource | float
+TypeError: Unsupported operand types: resource | float
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: string | null
+TypeError: Unsupported operand types: null | string
+TypeError: Unsupported operand types: string | bool
+TypeError: Unsupported operand types: bool | string
+TypeError: Unsupported operand types: string | bool
+TypeError: Unsupported operand types: bool | string
+TypeError: Unsupported operand types: string | int
+TypeError: Unsupported operand types: int | string
+TypeError: Unsupported operand types: string | float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float | string
+TypeError: Unsupported operand types: float | string
No error for "foo" | "123"
No error for "123" | "foo"
No error for "foo" | "123foo"
No error for "123foo" | "foo"
-Unsupported operand types: array ^ array
-Unsupported operand types: stdClass ^ array
-Unsupported operand types: resource ^ array
-Unsupported operand types: array ^ string
-Unsupported operand types: stdClass ^ array
-Unsupported operand types: stdClass ^ stdClass
-Unsupported operand types: stdClass ^ resource
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: resource ^ array
-Unsupported operand types: resource ^ stdClass
-Unsupported operand types: resource ^ resource
-Unsupported operand types: resource ^ string
-Unsupported operand types: string ^ array
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: array ^ array
+TypeError: Unsupported operand types: stdClass ^ array
+TypeError: Unsupported operand types: resource ^ array
+TypeError: Unsupported operand types: array ^ string
+TypeError: Unsupported operand types: stdClass ^ array
+TypeError: Unsupported operand types: stdClass ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ resource
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: resource ^ array
+TypeError: Unsupported operand types: resource ^ stdClass
+TypeError: Unsupported operand types: resource ^ resource
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: string ^ array
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: resource ^ string
No error for "foo" ^ "foo"
-Unsupported operand types: array ^ null
-Unsupported operand types: null ^ array
-Unsupported operand types: array ^ bool
-Unsupported operand types: bool ^ array
-Unsupported operand types: array ^ bool
-Unsupported operand types: bool ^ array
-Unsupported operand types: array ^ int
-Unsupported operand types: int ^ array
-Unsupported operand types: array ^ float
+TypeError: Unsupported operand types: array ^ null
+TypeError: Unsupported operand types: null ^ array
+TypeError: Unsupported operand types: array ^ bool
+TypeError: Unsupported operand types: bool ^ array
+TypeError: Unsupported operand types: array ^ bool
+TypeError: Unsupported operand types: bool ^ array
+TypeError: Unsupported operand types: array ^ int
+TypeError: Unsupported operand types: int ^ array
+TypeError: Unsupported operand types: array ^ float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float ^ array
-Unsupported operand types: array ^ string
-Unsupported operand types: string ^ array
-Unsupported operand types: array ^ string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ^ array
-Unsupported operand types: stdClass ^ null
-Unsupported operand types: stdClass ^ null
-Unsupported operand types: stdClass ^ bool
-Unsupported operand types: stdClass ^ bool
-Unsupported operand types: stdClass ^ bool
-Unsupported operand types: stdClass ^ bool
-Unsupported operand types: stdClass ^ int
-Unsupported operand types: stdClass ^ int
-Unsupported operand types: stdClass ^ float
-Unsupported operand types: stdClass ^ float
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: resource ^ null
-Unsupported operand types: resource ^ null
-Unsupported operand types: resource ^ bool
-Unsupported operand types: resource ^ bool
-Unsupported operand types: resource ^ bool
-Unsupported operand types: resource ^ bool
-Unsupported operand types: resource ^ int
-Unsupported operand types: resource ^ int
-Unsupported operand types: resource ^ float
-Unsupported operand types: resource ^ float
-Unsupported operand types: resource ^ string
-Unsupported operand types: resource ^ string
-Unsupported operand types: resource ^ string
-Unsupported operand types: resource ^ string
-Unsupported operand types: string ^ null
-Unsupported operand types: null ^ string
-Unsupported operand types: string ^ bool
-Unsupported operand types: bool ^ string
-Unsupported operand types: string ^ bool
-Unsupported operand types: bool ^ string
-Unsupported operand types: string ^ int
-Unsupported operand types: int ^ string
-Unsupported operand types: string ^ float
+TypeError: Unsupported operand types: float ^ array
+TypeError: Unsupported operand types: array ^ string
+TypeError: Unsupported operand types: string ^ array
+TypeError: Unsupported operand types: array ^ string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ^ array
+TypeError: Unsupported operand types: stdClass ^ null
+TypeError: Unsupported operand types: stdClass ^ null
+TypeError: Unsupported operand types: stdClass ^ bool
+TypeError: Unsupported operand types: stdClass ^ bool
+TypeError: Unsupported operand types: stdClass ^ bool
+TypeError: Unsupported operand types: stdClass ^ bool
+TypeError: Unsupported operand types: stdClass ^ int
+TypeError: Unsupported operand types: stdClass ^ int
+TypeError: Unsupported operand types: stdClass ^ float
+TypeError: Unsupported operand types: stdClass ^ float
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: resource ^ null
+TypeError: Unsupported operand types: resource ^ null
+TypeError: Unsupported operand types: resource ^ bool
+TypeError: Unsupported operand types: resource ^ bool
+TypeError: Unsupported operand types: resource ^ bool
+TypeError: Unsupported operand types: resource ^ bool
+TypeError: Unsupported operand types: resource ^ int
+TypeError: Unsupported operand types: resource ^ int
+TypeError: Unsupported operand types: resource ^ float
+TypeError: Unsupported operand types: resource ^ float
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: string ^ null
+TypeError: Unsupported operand types: null ^ string
+TypeError: Unsupported operand types: string ^ bool
+TypeError: Unsupported operand types: bool ^ string
+TypeError: Unsupported operand types: string ^ bool
+TypeError: Unsupported operand types: bool ^ string
+TypeError: Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: int ^ string
+TypeError: Unsupported operand types: string ^ float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float ^ string
+TypeError: Unsupported operand types: float ^ string
No error for "foo" ^ "123"
No error for "123" ^ "foo"
No error for "foo" ^ "123foo"
@@ -1045,24 +1045,24 @@ Warning: Array to string conversion
Warning: Array to string conversion
No error for [] . []
Warning: Array to string conversion
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
Warning: Array to string conversion
No error for [] . STDOUT
Warning: Array to string conversion
No error for [] . "foo"
Warning: Array to string conversion
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
Warning: Array to string conversion
No error for STDOUT . []
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
No error for STDOUT . STDOUT
No error for STDOUT . "foo"
Warning: Array to string conversion
No error for "foo" . []
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
No error for "foo" . STDOUT
No error for "foo" . "foo"
Warning: Array to string conversion
@@ -1093,20 +1093,20 @@ Warning: Array to string conversion
No error for [] . "123foo"
Warning: Array to string conversion
No error for "123foo" . []
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
No error for STDOUT . null
No error for null . STDOUT
No error for STDOUT . true
@@ -1139,858 +1139,858 @@ No error for "123foo" . "foo"
ASSIGN OP:
No error for [] += []
-Unsupported operand types: array + stdClass
-Unsupported operand types: array + resource
-Unsupported operand types: array + string
-Unsupported operand types: stdClass + array
-Unsupported operand types: stdClass + stdClass
-Unsupported operand types: stdClass + resource
-Unsupported operand types: stdClass + string
-Unsupported operand types: resource + array
-Unsupported operand types: resource + stdClass
-Unsupported operand types: resource + resource
-Unsupported operand types: resource + string
-Unsupported operand types: string + array
-Unsupported operand types: string + stdClass
-Unsupported operand types: string + resource
-Unsupported operand types: string + string
-Unsupported operand types: array + null
-Unsupported operand types: null + array
-Unsupported operand types: array + bool
-Unsupported operand types: bool + array
-Unsupported operand types: array + bool
-Unsupported operand types: bool + array
-Unsupported operand types: array + int
-Unsupported operand types: int + array
-Unsupported operand types: array + float
-Unsupported operand types: float + array
-Unsupported operand types: array + string
-Unsupported operand types: string + array
-Unsupported operand types: array + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + array
-Unsupported operand types: stdClass + null
-Unsupported operand types: null + stdClass
-Unsupported operand types: stdClass + bool
-Unsupported operand types: bool + stdClass
-Unsupported operand types: stdClass + bool
-Unsupported operand types: bool + stdClass
-Unsupported operand types: stdClass + int
-Unsupported operand types: int + stdClass
-Unsupported operand types: stdClass + float
-Unsupported operand types: float + stdClass
-Unsupported operand types: stdClass + string
-Unsupported operand types: string + stdClass
-Unsupported operand types: stdClass + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + stdClass
-Unsupported operand types: resource + null
-Unsupported operand types: null + resource
-Unsupported operand types: resource + bool
-Unsupported operand types: bool + resource
-Unsupported operand types: resource + bool
-Unsupported operand types: bool + resource
-Unsupported operand types: resource + int
-Unsupported operand types: int + resource
-Unsupported operand types: resource + float
-Unsupported operand types: float + resource
-Unsupported operand types: resource + string
-Unsupported operand types: string + resource
-Unsupported operand types: resource + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + resource
-Unsupported operand types: string + null
-Unsupported operand types: null + string
-Unsupported operand types: string + bool
-Unsupported operand types: bool + string
-Unsupported operand types: string + bool
-Unsupported operand types: bool + string
-Unsupported operand types: string + int
-Unsupported operand types: int + string
-Unsupported operand types: string + float
-Unsupported operand types: float + string
-Unsupported operand types: string + string
-Unsupported operand types: string + string
-Unsupported operand types: string + string
-Warning: A non-numeric value encountered
-Unsupported operand types: string + string
-Unsupported operand types: array - array
-Unsupported operand types: array - stdClass
-Unsupported operand types: array - resource
-Unsupported operand types: array - string
-Unsupported operand types: stdClass - array
-Unsupported operand types: stdClass - stdClass
-Unsupported operand types: stdClass - resource
-Unsupported operand types: stdClass - string
-Unsupported operand types: resource - array
-Unsupported operand types: resource - stdClass
-Unsupported operand types: resource - resource
-Unsupported operand types: resource - string
-Unsupported operand types: string - array
-Unsupported operand types: string - stdClass
-Unsupported operand types: string - resource
-Unsupported operand types: string - string
-Unsupported operand types: array - null
-Unsupported operand types: null - array
-Unsupported operand types: array - bool
-Unsupported operand types: bool - array
-Unsupported operand types: array - bool
-Unsupported operand types: bool - array
-Unsupported operand types: array - int
-Unsupported operand types: int - array
-Unsupported operand types: array - float
-Unsupported operand types: float - array
-Unsupported operand types: array - string
-Unsupported operand types: string - array
-Unsupported operand types: array - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - array
-Unsupported operand types: stdClass - null
-Unsupported operand types: null - stdClass
-Unsupported operand types: stdClass - bool
-Unsupported operand types: bool - stdClass
-Unsupported operand types: stdClass - bool
-Unsupported operand types: bool - stdClass
-Unsupported operand types: stdClass - int
-Unsupported operand types: int - stdClass
-Unsupported operand types: stdClass - float
-Unsupported operand types: float - stdClass
-Unsupported operand types: stdClass - string
-Unsupported operand types: string - stdClass
-Unsupported operand types: stdClass - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - stdClass
-Unsupported operand types: resource - null
-Unsupported operand types: null - resource
-Unsupported operand types: resource - bool
-Unsupported operand types: bool - resource
-Unsupported operand types: resource - bool
-Unsupported operand types: bool - resource
-Unsupported operand types: resource - int
-Unsupported operand types: int - resource
-Unsupported operand types: resource - float
-Unsupported operand types: float - resource
-Unsupported operand types: resource - string
-Unsupported operand types: string - resource
-Unsupported operand types: resource - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - resource
-Unsupported operand types: string - null
-Unsupported operand types: null - string
-Unsupported operand types: string - bool
-Unsupported operand types: bool - string
-Unsupported operand types: string - bool
-Unsupported operand types: bool - string
-Unsupported operand types: string - int
-Unsupported operand types: int - string
-Unsupported operand types: string - float
-Unsupported operand types: float - string
-Unsupported operand types: string - string
-Unsupported operand types: string - string
-Unsupported operand types: string - string
-Warning: A non-numeric value encountered
-Unsupported operand types: string - string
-Unsupported operand types: array * array
-Unsupported operand types: array * stdClass
-Unsupported operand types: array * resource
-Unsupported operand types: array * string
-Unsupported operand types: stdClass * array
-Unsupported operand types: stdClass * stdClass
-Unsupported operand types: stdClass * resource
-Unsupported operand types: stdClass * string
-Unsupported operand types: resource * array
-Unsupported operand types: resource * stdClass
-Unsupported operand types: resource * resource
-Unsupported operand types: resource * string
-Unsupported operand types: string * array
-Unsupported operand types: string * stdClass
-Unsupported operand types: string * resource
-Unsupported operand types: string * string
-Unsupported operand types: array * null
-Unsupported operand types: null * array
-Unsupported operand types: array * bool
-Unsupported operand types: bool * array
-Unsupported operand types: array * bool
-Unsupported operand types: bool * array
-Unsupported operand types: array * int
-Unsupported operand types: int * array
-Unsupported operand types: array * float
-Unsupported operand types: float * array
-Unsupported operand types: array * string
-Unsupported operand types: string * array
-Unsupported operand types: array * string
-Warning: A non-numeric value encountered
-Unsupported operand types: string * array
-Unsupported operand types: stdClass * null
-Unsupported operand types: null * stdClass
-Unsupported operand types: stdClass * bool
-Unsupported operand types: bool * stdClass
-Unsupported operand types: stdClass * bool
-Unsupported operand types: bool * stdClass
-Unsupported operand types: stdClass * int
-Unsupported operand types: int * stdClass
-Unsupported operand types: stdClass * float
-Unsupported operand types: float * stdClass
-Unsupported operand types: stdClass * string
-Unsupported operand types: string * stdClass
-Unsupported operand types: stdClass * string
-Warning: A non-numeric value encountered
-Unsupported operand types: string * stdClass
-Unsupported operand types: resource * null
-Unsupported operand types: null * resource
-Unsupported operand types: resource * bool
-Unsupported operand types: bool * resource
-Unsupported operand types: resource * bool
-Unsupported operand types: bool * resource
-Unsupported operand types: resource * int
-Unsupported operand types: int * resource
-Unsupported operand types: resource * float
-Unsupported operand types: float * resource
-Unsupported operand types: resource * string
-Unsupported operand types: string * resource
-Unsupported operand types: resource * string
-Warning: A non-numeric value encountered
-Unsupported operand types: string * resource
-Unsupported operand types: string * null
-Unsupported operand types: null * string
-Unsupported operand types: string * bool
-Unsupported operand types: bool * string
-Unsupported operand types: string * bool
-Unsupported operand types: bool * string
-Unsupported operand types: string * int
-Unsupported operand types: int * string
-Unsupported operand types: string * float
-Unsupported operand types: float * string
-Unsupported operand types: string * string
-Unsupported operand types: string * string
-Unsupported operand types: string * string
-Warning: A non-numeric value encountered
-Unsupported operand types: string * string
-Unsupported operand types: array / array
-Unsupported operand types: array / stdClass
-Unsupported operand types: array / resource
-Unsupported operand types: array / string
-Unsupported operand types: stdClass / array
-Unsupported operand types: stdClass / stdClass
-Unsupported operand types: stdClass / resource
-Unsupported operand types: stdClass / string
-Unsupported operand types: resource / array
-Unsupported operand types: resource / stdClass
-Unsupported operand types: resource / resource
-Unsupported operand types: resource / string
-Unsupported operand types: string / array
-Unsupported operand types: string / stdClass
-Unsupported operand types: string / resource
-Unsupported operand types: string / string
-Unsupported operand types: array / null
-Unsupported operand types: null / array
-Unsupported operand types: array / bool
-Unsupported operand types: bool / array
-Unsupported operand types: array / bool
-Unsupported operand types: bool / array
-Unsupported operand types: array / int
-Unsupported operand types: int / array
-Unsupported operand types: array / float
-Unsupported operand types: float / array
-Unsupported operand types: array / string
-Unsupported operand types: string / array
-Unsupported operand types: array / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / array
-Unsupported operand types: stdClass / null
-Unsupported operand types: null / stdClass
-Unsupported operand types: stdClass / bool
-Unsupported operand types: bool / stdClass
-Unsupported operand types: stdClass / bool
-Unsupported operand types: bool / stdClass
-Unsupported operand types: stdClass / int
-Unsupported operand types: int / stdClass
-Unsupported operand types: stdClass / float
-Unsupported operand types: float / stdClass
-Unsupported operand types: stdClass / string
-Unsupported operand types: string / stdClass
-Unsupported operand types: stdClass / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / stdClass
-Unsupported operand types: resource / null
-Unsupported operand types: null / resource
-Unsupported operand types: resource / bool
-Unsupported operand types: bool / resource
-Unsupported operand types: resource / bool
-Unsupported operand types: bool / resource
-Unsupported operand types: resource / int
-Unsupported operand types: int / resource
-Unsupported operand types: resource / float
-Unsupported operand types: float / resource
-Unsupported operand types: resource / string
-Unsupported operand types: string / resource
-Unsupported operand types: resource / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / resource
-Unsupported operand types: string / null
-Unsupported operand types: null / string
-Unsupported operand types: string / bool
-Unsupported operand types: bool / string
-Unsupported operand types: string / bool
-Unsupported operand types: bool / string
-Unsupported operand types: string / int
-Unsupported operand types: int / string
-Unsupported operand types: string / float
-Unsupported operand types: float / string
-Unsupported operand types: string / string
-Unsupported operand types: string / string
-Unsupported operand types: string / string
-Warning: A non-numeric value encountered
-Unsupported operand types: string / string
-Unsupported operand types: array % array
-Unsupported operand types: array % stdClass
-Unsupported operand types: array % resource
-Unsupported operand types: array % string
-Unsupported operand types: stdClass % array
-Unsupported operand types: stdClass % stdClass
-Unsupported operand types: stdClass % resource
-Unsupported operand types: stdClass % string
-Unsupported operand types: resource % array
-Unsupported operand types: resource % stdClass
-Unsupported operand types: resource % resource
-Unsupported operand types: resource % string
-Unsupported operand types: string % array
-Unsupported operand types: string % stdClass
-Unsupported operand types: string % resource
-Unsupported operand types: string % string
-Unsupported operand types: array % null
-Unsupported operand types: null % array
-Unsupported operand types: array % bool
-Unsupported operand types: bool % array
-Unsupported operand types: array % bool
-Unsupported operand types: bool % array
-Unsupported operand types: array % int
-Unsupported operand types: int % array
-Unsupported operand types: array % float
+TypeError: Unsupported operand types: array + stdClass
+TypeError: Unsupported operand types: array + resource
+TypeError: Unsupported operand types: array + string
+TypeError: Unsupported operand types: stdClass + array
+TypeError: Unsupported operand types: stdClass + stdClass
+TypeError: Unsupported operand types: stdClass + resource
+TypeError: Unsupported operand types: stdClass + string
+TypeError: Unsupported operand types: resource + array
+TypeError: Unsupported operand types: resource + stdClass
+TypeError: Unsupported operand types: resource + resource
+TypeError: Unsupported operand types: resource + string
+TypeError: Unsupported operand types: string + array
+TypeError: Unsupported operand types: string + stdClass
+TypeError: Unsupported operand types: string + resource
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: array + null
+TypeError: Unsupported operand types: null + array
+TypeError: Unsupported operand types: array + bool
+TypeError: Unsupported operand types: bool + array
+TypeError: Unsupported operand types: array + bool
+TypeError: Unsupported operand types: bool + array
+TypeError: Unsupported operand types: array + int
+TypeError: Unsupported operand types: int + array
+TypeError: Unsupported operand types: array + float
+TypeError: Unsupported operand types: float + array
+TypeError: Unsupported operand types: array + string
+TypeError: Unsupported operand types: string + array
+TypeError: Unsupported operand types: array + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + array
+TypeError: Unsupported operand types: stdClass + null
+TypeError: Unsupported operand types: null + stdClass
+TypeError: Unsupported operand types: stdClass + bool
+TypeError: Unsupported operand types: bool + stdClass
+TypeError: Unsupported operand types: stdClass + bool
+TypeError: Unsupported operand types: bool + stdClass
+TypeError: Unsupported operand types: stdClass + int
+TypeError: Unsupported operand types: int + stdClass
+TypeError: Unsupported operand types: stdClass + float
+TypeError: Unsupported operand types: float + stdClass
+TypeError: Unsupported operand types: stdClass + string
+TypeError: Unsupported operand types: string + stdClass
+TypeError: Unsupported operand types: stdClass + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + stdClass
+TypeError: Unsupported operand types: resource + null
+TypeError: Unsupported operand types: null + resource
+TypeError: Unsupported operand types: resource + bool
+TypeError: Unsupported operand types: bool + resource
+TypeError: Unsupported operand types: resource + bool
+TypeError: Unsupported operand types: bool + resource
+TypeError: Unsupported operand types: resource + int
+TypeError: Unsupported operand types: int + resource
+TypeError: Unsupported operand types: resource + float
+TypeError: Unsupported operand types: float + resource
+TypeError: Unsupported operand types: resource + string
+TypeError: Unsupported operand types: string + resource
+TypeError: Unsupported operand types: resource + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + resource
+TypeError: Unsupported operand types: string + null
+TypeError: Unsupported operand types: null + string
+TypeError: Unsupported operand types: string + bool
+TypeError: Unsupported operand types: bool + string
+TypeError: Unsupported operand types: string + bool
+TypeError: Unsupported operand types: bool + string
+TypeError: Unsupported operand types: string + int
+TypeError: Unsupported operand types: int + string
+TypeError: Unsupported operand types: string + float
+TypeError: Unsupported operand types: float + string
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: string + string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string + string
+TypeError: Unsupported operand types: array - array
+TypeError: Unsupported operand types: array - stdClass
+TypeError: Unsupported operand types: array - resource
+TypeError: Unsupported operand types: array - string
+TypeError: Unsupported operand types: stdClass - array
+TypeError: Unsupported operand types: stdClass - stdClass
+TypeError: Unsupported operand types: stdClass - resource
+TypeError: Unsupported operand types: stdClass - string
+TypeError: Unsupported operand types: resource - array
+TypeError: Unsupported operand types: resource - stdClass
+TypeError: Unsupported operand types: resource - resource
+TypeError: Unsupported operand types: resource - string
+TypeError: Unsupported operand types: string - array
+TypeError: Unsupported operand types: string - stdClass
+TypeError: Unsupported operand types: string - resource
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: array - null
+TypeError: Unsupported operand types: null - array
+TypeError: Unsupported operand types: array - bool
+TypeError: Unsupported operand types: bool - array
+TypeError: Unsupported operand types: array - bool
+TypeError: Unsupported operand types: bool - array
+TypeError: Unsupported operand types: array - int
+TypeError: Unsupported operand types: int - array
+TypeError: Unsupported operand types: array - float
+TypeError: Unsupported operand types: float - array
+TypeError: Unsupported operand types: array - string
+TypeError: Unsupported operand types: string - array
+TypeError: Unsupported operand types: array - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - array
+TypeError: Unsupported operand types: stdClass - null
+TypeError: Unsupported operand types: null - stdClass
+TypeError: Unsupported operand types: stdClass - bool
+TypeError: Unsupported operand types: bool - stdClass
+TypeError: Unsupported operand types: stdClass - bool
+TypeError: Unsupported operand types: bool - stdClass
+TypeError: Unsupported operand types: stdClass - int
+TypeError: Unsupported operand types: int - stdClass
+TypeError: Unsupported operand types: stdClass - float
+TypeError: Unsupported operand types: float - stdClass
+TypeError: Unsupported operand types: stdClass - string
+TypeError: Unsupported operand types: string - stdClass
+TypeError: Unsupported operand types: stdClass - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - stdClass
+TypeError: Unsupported operand types: resource - null
+TypeError: Unsupported operand types: null - resource
+TypeError: Unsupported operand types: resource - bool
+TypeError: Unsupported operand types: bool - resource
+TypeError: Unsupported operand types: resource - bool
+TypeError: Unsupported operand types: bool - resource
+TypeError: Unsupported operand types: resource - int
+TypeError: Unsupported operand types: int - resource
+TypeError: Unsupported operand types: resource - float
+TypeError: Unsupported operand types: float - resource
+TypeError: Unsupported operand types: resource - string
+TypeError: Unsupported operand types: string - resource
+TypeError: Unsupported operand types: resource - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - resource
+TypeError: Unsupported operand types: string - null
+TypeError: Unsupported operand types: null - string
+TypeError: Unsupported operand types: string - bool
+TypeError: Unsupported operand types: bool - string
+TypeError: Unsupported operand types: string - bool
+TypeError: Unsupported operand types: bool - string
+TypeError: Unsupported operand types: string - int
+TypeError: Unsupported operand types: int - string
+TypeError: Unsupported operand types: string - float
+TypeError: Unsupported operand types: float - string
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: string - string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string - string
+TypeError: Unsupported operand types: array * array
+TypeError: Unsupported operand types: array * stdClass
+TypeError: Unsupported operand types: array * resource
+TypeError: Unsupported operand types: array * string
+TypeError: Unsupported operand types: stdClass * array
+TypeError: Unsupported operand types: stdClass * stdClass
+TypeError: Unsupported operand types: stdClass * resource
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: resource * array
+TypeError: Unsupported operand types: resource * stdClass
+TypeError: Unsupported operand types: resource * resource
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: string * array
+TypeError: Unsupported operand types: string * stdClass
+TypeError: Unsupported operand types: string * resource
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: array * null
+TypeError: Unsupported operand types: null * array
+TypeError: Unsupported operand types: array * bool
+TypeError: Unsupported operand types: bool * array
+TypeError: Unsupported operand types: array * bool
+TypeError: Unsupported operand types: bool * array
+TypeError: Unsupported operand types: array * int
+TypeError: Unsupported operand types: int * array
+TypeError: Unsupported operand types: array * float
+TypeError: Unsupported operand types: float * array
+TypeError: Unsupported operand types: array * string
+TypeError: Unsupported operand types: string * array
+TypeError: Unsupported operand types: array * string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string * array
+TypeError: Unsupported operand types: stdClass * null
+TypeError: Unsupported operand types: null * stdClass
+TypeError: Unsupported operand types: stdClass * bool
+TypeError: Unsupported operand types: bool * stdClass
+TypeError: Unsupported operand types: stdClass * bool
+TypeError: Unsupported operand types: bool * stdClass
+TypeError: Unsupported operand types: stdClass * int
+TypeError: Unsupported operand types: int * stdClass
+TypeError: Unsupported operand types: stdClass * float
+TypeError: Unsupported operand types: float * stdClass
+TypeError: Unsupported operand types: stdClass * string
+TypeError: Unsupported operand types: string * stdClass
+TypeError: Unsupported operand types: stdClass * string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string * stdClass
+TypeError: Unsupported operand types: resource * null
+TypeError: Unsupported operand types: null * resource
+TypeError: Unsupported operand types: resource * bool
+TypeError: Unsupported operand types: bool * resource
+TypeError: Unsupported operand types: resource * bool
+TypeError: Unsupported operand types: bool * resource
+TypeError: Unsupported operand types: resource * int
+TypeError: Unsupported operand types: int * resource
+TypeError: Unsupported operand types: resource * float
+TypeError: Unsupported operand types: float * resource
+TypeError: Unsupported operand types: resource * string
+TypeError: Unsupported operand types: string * resource
+TypeError: Unsupported operand types: resource * string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string * resource
+TypeError: Unsupported operand types: string * null
+TypeError: Unsupported operand types: null * string
+TypeError: Unsupported operand types: string * bool
+TypeError: Unsupported operand types: bool * string
+TypeError: Unsupported operand types: string * bool
+TypeError: Unsupported operand types: bool * string
+TypeError: Unsupported operand types: string * int
+TypeError: Unsupported operand types: int * string
+TypeError: Unsupported operand types: string * float
+TypeError: Unsupported operand types: float * string
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: string * string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string * string
+TypeError: Unsupported operand types: array / array
+TypeError: Unsupported operand types: array / stdClass
+TypeError: Unsupported operand types: array / resource
+TypeError: Unsupported operand types: array / string
+TypeError: Unsupported operand types: stdClass / array
+TypeError: Unsupported operand types: stdClass / stdClass
+TypeError: Unsupported operand types: stdClass / resource
+TypeError: Unsupported operand types: stdClass / string
+TypeError: Unsupported operand types: resource / array
+TypeError: Unsupported operand types: resource / stdClass
+TypeError: Unsupported operand types: resource / resource
+TypeError: Unsupported operand types: resource / string
+TypeError: Unsupported operand types: string / array
+TypeError: Unsupported operand types: string / stdClass
+TypeError: Unsupported operand types: string / resource
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: array / null
+TypeError: Unsupported operand types: null / array
+TypeError: Unsupported operand types: array / bool
+TypeError: Unsupported operand types: bool / array
+TypeError: Unsupported operand types: array / bool
+TypeError: Unsupported operand types: bool / array
+TypeError: Unsupported operand types: array / int
+TypeError: Unsupported operand types: int / array
+TypeError: Unsupported operand types: array / float
+TypeError: Unsupported operand types: float / array
+TypeError: Unsupported operand types: array / string
+TypeError: Unsupported operand types: string / array
+TypeError: Unsupported operand types: array / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / array
+TypeError: Unsupported operand types: stdClass / null
+TypeError: Unsupported operand types: null / stdClass
+TypeError: Unsupported operand types: stdClass / bool
+TypeError: Unsupported operand types: bool / stdClass
+TypeError: Unsupported operand types: stdClass / bool
+TypeError: Unsupported operand types: bool / stdClass
+TypeError: Unsupported operand types: stdClass / int
+TypeError: Unsupported operand types: int / stdClass
+TypeError: Unsupported operand types: stdClass / float
+TypeError: Unsupported operand types: float / stdClass
+TypeError: Unsupported operand types: stdClass / string
+TypeError: Unsupported operand types: string / stdClass
+TypeError: Unsupported operand types: stdClass / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / stdClass
+TypeError: Unsupported operand types: resource / null
+TypeError: Unsupported operand types: null / resource
+TypeError: Unsupported operand types: resource / bool
+TypeError: Unsupported operand types: bool / resource
+TypeError: Unsupported operand types: resource / bool
+TypeError: Unsupported operand types: bool / resource
+TypeError: Unsupported operand types: resource / int
+TypeError: Unsupported operand types: int / resource
+TypeError: Unsupported operand types: resource / float
+TypeError: Unsupported operand types: float / resource
+TypeError: Unsupported operand types: resource / string
+TypeError: Unsupported operand types: string / resource
+TypeError: Unsupported operand types: resource / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / resource
+TypeError: Unsupported operand types: string / null
+TypeError: Unsupported operand types: null / string
+TypeError: Unsupported operand types: string / bool
+TypeError: Unsupported operand types: bool / string
+TypeError: Unsupported operand types: string / bool
+TypeError: Unsupported operand types: bool / string
+TypeError: Unsupported operand types: string / int
+TypeError: Unsupported operand types: int / string
+TypeError: Unsupported operand types: string / float
+TypeError: Unsupported operand types: float / string
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: string / string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string / string
+TypeError: Unsupported operand types: array % array
+TypeError: Unsupported operand types: array % stdClass
+TypeError: Unsupported operand types: array % resource
+TypeError: Unsupported operand types: array % string
+TypeError: Unsupported operand types: stdClass % array
+TypeError: Unsupported operand types: stdClass % stdClass
+TypeError: Unsupported operand types: stdClass % resource
+TypeError: Unsupported operand types: stdClass % string
+TypeError: Unsupported operand types: resource % array
+TypeError: Unsupported operand types: resource % stdClass
+TypeError: Unsupported operand types: resource % resource
+TypeError: Unsupported operand types: resource % string
+TypeError: Unsupported operand types: string % array
+TypeError: Unsupported operand types: string % stdClass
+TypeError: Unsupported operand types: string % resource
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: array % null
+TypeError: Unsupported operand types: null % array
+TypeError: Unsupported operand types: array % bool
+TypeError: Unsupported operand types: bool % array
+TypeError: Unsupported operand types: array % bool
+TypeError: Unsupported operand types: bool % array
+TypeError: Unsupported operand types: array % int
+TypeError: Unsupported operand types: int % array
+TypeError: Unsupported operand types: array % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % array
-Unsupported operand types: array % string
-Unsupported operand types: string % array
-Unsupported operand types: array % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % array
-Unsupported operand types: stdClass % null
-Unsupported operand types: null % stdClass
-Unsupported operand types: stdClass % bool
-Unsupported operand types: bool % stdClass
-Unsupported operand types: stdClass % bool
-Unsupported operand types: bool % stdClass
-Unsupported operand types: stdClass % int
-Unsupported operand types: int % stdClass
-Unsupported operand types: stdClass % float
+TypeError: Unsupported operand types: float % array
+TypeError: Unsupported operand types: array % string
+TypeError: Unsupported operand types: string % array
+TypeError: Unsupported operand types: array % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % array
+TypeError: Unsupported operand types: stdClass % null
+TypeError: Unsupported operand types: null % stdClass
+TypeError: Unsupported operand types: stdClass % bool
+TypeError: Unsupported operand types: bool % stdClass
+TypeError: Unsupported operand types: stdClass % bool
+TypeError: Unsupported operand types: bool % stdClass
+TypeError: Unsupported operand types: stdClass % int
+TypeError: Unsupported operand types: int % stdClass
+TypeError: Unsupported operand types: stdClass % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % stdClass
-Unsupported operand types: stdClass % string
-Unsupported operand types: string % stdClass
-Unsupported operand types: stdClass % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % stdClass
-Unsupported operand types: resource % null
-Unsupported operand types: null % resource
-Unsupported operand types: resource % bool
-Unsupported operand types: bool % resource
-Unsupported operand types: resource % bool
-Unsupported operand types: bool % resource
-Unsupported operand types: resource % int
-Unsupported operand types: int % resource
-Unsupported operand types: resource % float
+TypeError: Unsupported operand types: float % stdClass
+TypeError: Unsupported operand types: stdClass % string
+TypeError: Unsupported operand types: string % stdClass
+TypeError: Unsupported operand types: stdClass % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % stdClass
+TypeError: Unsupported operand types: resource % null
+TypeError: Unsupported operand types: null % resource
+TypeError: Unsupported operand types: resource % bool
+TypeError: Unsupported operand types: bool % resource
+TypeError: Unsupported operand types: resource % bool
+TypeError: Unsupported operand types: bool % resource
+TypeError: Unsupported operand types: resource % int
+TypeError: Unsupported operand types: int % resource
+TypeError: Unsupported operand types: resource % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % resource
-Unsupported operand types: resource % string
-Unsupported operand types: string % resource
-Unsupported operand types: resource % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % resource
-Unsupported operand types: string % null
-Unsupported operand types: null % string
-Unsupported operand types: string % bool
-Unsupported operand types: bool % string
-Unsupported operand types: string % bool
-Unsupported operand types: bool % string
-Unsupported operand types: string % int
-Unsupported operand types: int % string
-Unsupported operand types: string % float
+TypeError: Unsupported operand types: float % resource
+TypeError: Unsupported operand types: resource % string
+TypeError: Unsupported operand types: string % resource
+TypeError: Unsupported operand types: resource % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % resource
+TypeError: Unsupported operand types: string % null
+TypeError: Unsupported operand types: null % string
+TypeError: Unsupported operand types: string % bool
+TypeError: Unsupported operand types: bool % string
+TypeError: Unsupported operand types: string % bool
+TypeError: Unsupported operand types: bool % string
+TypeError: Unsupported operand types: string % int
+TypeError: Unsupported operand types: int % string
+TypeError: Unsupported operand types: string % float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float % string
-Unsupported operand types: string % string
-Unsupported operand types: string % string
-Unsupported operand types: string % string
-Warning: A non-numeric value encountered
-Unsupported operand types: string % string
-Unsupported operand types: array ** array
-Unsupported operand types: array ** stdClass
-Unsupported operand types: array ** resource
-Unsupported operand types: array ** string
-Unsupported operand types: stdClass ** array
-Unsupported operand types: stdClass ** stdClass
-Unsupported operand types: stdClass ** resource
-Unsupported operand types: stdClass ** string
-Unsupported operand types: resource ** array
-Unsupported operand types: resource ** stdClass
-Unsupported operand types: resource ** resource
-Unsupported operand types: resource ** string
-Unsupported operand types: string ** array
-Unsupported operand types: string ** stdClass
-Unsupported operand types: string ** resource
-Unsupported operand types: string ** string
-Unsupported operand types: array ** null
-Unsupported operand types: null ** array
-Unsupported operand types: array ** bool
-Unsupported operand types: bool ** array
-Unsupported operand types: array ** bool
-Unsupported operand types: bool ** array
-Unsupported operand types: array ** int
-Unsupported operand types: int ** array
-Unsupported operand types: array ** float
-Unsupported operand types: float ** array
-Unsupported operand types: array ** string
-Unsupported operand types: string ** array
-Unsupported operand types: array ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** array
-Unsupported operand types: stdClass ** null
-Unsupported operand types: null ** stdClass
-Unsupported operand types: stdClass ** bool
-Unsupported operand types: bool ** stdClass
-Unsupported operand types: stdClass ** bool
-Unsupported operand types: bool ** stdClass
-Unsupported operand types: stdClass ** int
-Unsupported operand types: int ** stdClass
-Unsupported operand types: stdClass ** float
-Unsupported operand types: float ** stdClass
-Unsupported operand types: stdClass ** string
-Unsupported operand types: string ** stdClass
-Unsupported operand types: stdClass ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** stdClass
-Unsupported operand types: resource ** null
-Unsupported operand types: null ** resource
-Unsupported operand types: resource ** bool
-Unsupported operand types: bool ** resource
-Unsupported operand types: resource ** bool
-Unsupported operand types: bool ** resource
-Unsupported operand types: resource ** int
-Unsupported operand types: int ** resource
-Unsupported operand types: resource ** float
-Unsupported operand types: float ** resource
-Unsupported operand types: resource ** string
-Unsupported operand types: string ** resource
-Unsupported operand types: resource ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** resource
-Unsupported operand types: string ** null
-Unsupported operand types: null ** string
-Unsupported operand types: string ** bool
-Unsupported operand types: bool ** string
-Unsupported operand types: string ** bool
-Unsupported operand types: bool ** string
-Unsupported operand types: string ** int
-Unsupported operand types: int ** string
-Unsupported operand types: string ** float
-Unsupported operand types: float ** string
-Unsupported operand types: string ** string
-Unsupported operand types: string ** string
-Unsupported operand types: string ** string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ** string
-Unsupported operand types: array << array
-Unsupported operand types: array << stdClass
-Unsupported operand types: array << resource
-Unsupported operand types: array << string
-Unsupported operand types: stdClass << array
-Unsupported operand types: stdClass << stdClass
-Unsupported operand types: stdClass << resource
-Unsupported operand types: stdClass << string
-Unsupported operand types: resource << array
-Unsupported operand types: resource << stdClass
-Unsupported operand types: resource << resource
-Unsupported operand types: resource << string
-Unsupported operand types: string << array
-Unsupported operand types: string << stdClass
-Unsupported operand types: string << resource
-Unsupported operand types: string << string
-Unsupported operand types: array << null
-Unsupported operand types: null << array
-Unsupported operand types: array << bool
-Unsupported operand types: bool << array
-Unsupported operand types: array << bool
-Unsupported operand types: bool << array
-Unsupported operand types: array << int
-Unsupported operand types: int << array
-Unsupported operand types: array << float
+TypeError: Unsupported operand types: float % string
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: string % string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string % string
+TypeError: Unsupported operand types: array ** array
+TypeError: Unsupported operand types: array ** stdClass
+TypeError: Unsupported operand types: array ** resource
+TypeError: Unsupported operand types: array ** string
+TypeError: Unsupported operand types: stdClass ** array
+TypeError: Unsupported operand types: stdClass ** stdClass
+TypeError: Unsupported operand types: stdClass ** resource
+TypeError: Unsupported operand types: stdClass ** string
+TypeError: Unsupported operand types: resource ** array
+TypeError: Unsupported operand types: resource ** stdClass
+TypeError: Unsupported operand types: resource ** resource
+TypeError: Unsupported operand types: resource ** string
+TypeError: Unsupported operand types: string ** array
+TypeError: Unsupported operand types: string ** stdClass
+TypeError: Unsupported operand types: string ** resource
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: array ** null
+TypeError: Unsupported operand types: null ** array
+TypeError: Unsupported operand types: array ** bool
+TypeError: Unsupported operand types: bool ** array
+TypeError: Unsupported operand types: array ** bool
+TypeError: Unsupported operand types: bool ** array
+TypeError: Unsupported operand types: array ** int
+TypeError: Unsupported operand types: int ** array
+TypeError: Unsupported operand types: array ** float
+TypeError: Unsupported operand types: float ** array
+TypeError: Unsupported operand types: array ** string
+TypeError: Unsupported operand types: string ** array
+TypeError: Unsupported operand types: array ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** array
+TypeError: Unsupported operand types: stdClass ** null
+TypeError: Unsupported operand types: null ** stdClass
+TypeError: Unsupported operand types: stdClass ** bool
+TypeError: Unsupported operand types: bool ** stdClass
+TypeError: Unsupported operand types: stdClass ** bool
+TypeError: Unsupported operand types: bool ** stdClass
+TypeError: Unsupported operand types: stdClass ** int
+TypeError: Unsupported operand types: int ** stdClass
+TypeError: Unsupported operand types: stdClass ** float
+TypeError: Unsupported operand types: float ** stdClass
+TypeError: Unsupported operand types: stdClass ** string
+TypeError: Unsupported operand types: string ** stdClass
+TypeError: Unsupported operand types: stdClass ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** stdClass
+TypeError: Unsupported operand types: resource ** null
+TypeError: Unsupported operand types: null ** resource
+TypeError: Unsupported operand types: resource ** bool
+TypeError: Unsupported operand types: bool ** resource
+TypeError: Unsupported operand types: resource ** bool
+TypeError: Unsupported operand types: bool ** resource
+TypeError: Unsupported operand types: resource ** int
+TypeError: Unsupported operand types: int ** resource
+TypeError: Unsupported operand types: resource ** float
+TypeError: Unsupported operand types: float ** resource
+TypeError: Unsupported operand types: resource ** string
+TypeError: Unsupported operand types: string ** resource
+TypeError: Unsupported operand types: resource ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** resource
+TypeError: Unsupported operand types: string ** null
+TypeError: Unsupported operand types: null ** string
+TypeError: Unsupported operand types: string ** bool
+TypeError: Unsupported operand types: bool ** string
+TypeError: Unsupported operand types: string ** bool
+TypeError: Unsupported operand types: bool ** string
+TypeError: Unsupported operand types: string ** int
+TypeError: Unsupported operand types: int ** string
+TypeError: Unsupported operand types: string ** float
+TypeError: Unsupported operand types: float ** string
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: string ** string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ** string
+TypeError: Unsupported operand types: array << array
+TypeError: Unsupported operand types: array << stdClass
+TypeError: Unsupported operand types: array << resource
+TypeError: Unsupported operand types: array << string
+TypeError: Unsupported operand types: stdClass << array
+TypeError: Unsupported operand types: stdClass << stdClass
+TypeError: Unsupported operand types: stdClass << resource
+TypeError: Unsupported operand types: stdClass << string
+TypeError: Unsupported operand types: resource << array
+TypeError: Unsupported operand types: resource << stdClass
+TypeError: Unsupported operand types: resource << resource
+TypeError: Unsupported operand types: resource << string
+TypeError: Unsupported operand types: string << array
+TypeError: Unsupported operand types: string << stdClass
+TypeError: Unsupported operand types: string << resource
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: array << null
+TypeError: Unsupported operand types: null << array
+TypeError: Unsupported operand types: array << bool
+TypeError: Unsupported operand types: bool << array
+TypeError: Unsupported operand types: array << bool
+TypeError: Unsupported operand types: bool << array
+TypeError: Unsupported operand types: array << int
+TypeError: Unsupported operand types: int << array
+TypeError: Unsupported operand types: array << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << array
-Unsupported operand types: array << string
-Unsupported operand types: string << array
-Unsupported operand types: array << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << array
-Unsupported operand types: stdClass << null
-Unsupported operand types: null << stdClass
-Unsupported operand types: stdClass << bool
-Unsupported operand types: bool << stdClass
-Unsupported operand types: stdClass << bool
-Unsupported operand types: bool << stdClass
-Unsupported operand types: stdClass << int
-Unsupported operand types: int << stdClass
-Unsupported operand types: stdClass << float
+TypeError: Unsupported operand types: float << array
+TypeError: Unsupported operand types: array << string
+TypeError: Unsupported operand types: string << array
+TypeError: Unsupported operand types: array << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << array
+TypeError: Unsupported operand types: stdClass << null
+TypeError: Unsupported operand types: null << stdClass
+TypeError: Unsupported operand types: stdClass << bool
+TypeError: Unsupported operand types: bool << stdClass
+TypeError: Unsupported operand types: stdClass << bool
+TypeError: Unsupported operand types: bool << stdClass
+TypeError: Unsupported operand types: stdClass << int
+TypeError: Unsupported operand types: int << stdClass
+TypeError: Unsupported operand types: stdClass << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << stdClass
-Unsupported operand types: stdClass << string
-Unsupported operand types: string << stdClass
-Unsupported operand types: stdClass << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << stdClass
-Unsupported operand types: resource << null
-Unsupported operand types: null << resource
-Unsupported operand types: resource << bool
-Unsupported operand types: bool << resource
-Unsupported operand types: resource << bool
-Unsupported operand types: bool << resource
-Unsupported operand types: resource << int
-Unsupported operand types: int << resource
-Unsupported operand types: resource << float
+TypeError: Unsupported operand types: float << stdClass
+TypeError: Unsupported operand types: stdClass << string
+TypeError: Unsupported operand types: string << stdClass
+TypeError: Unsupported operand types: stdClass << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << stdClass
+TypeError: Unsupported operand types: resource << null
+TypeError: Unsupported operand types: null << resource
+TypeError: Unsupported operand types: resource << bool
+TypeError: Unsupported operand types: bool << resource
+TypeError: Unsupported operand types: resource << bool
+TypeError: Unsupported operand types: bool << resource
+TypeError: Unsupported operand types: resource << int
+TypeError: Unsupported operand types: int << resource
+TypeError: Unsupported operand types: resource << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << resource
-Unsupported operand types: resource << string
-Unsupported operand types: string << resource
-Unsupported operand types: resource << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << resource
-Unsupported operand types: string << null
-Unsupported operand types: null << string
-Unsupported operand types: string << bool
-Unsupported operand types: bool << string
-Unsupported operand types: string << bool
-Unsupported operand types: bool << string
-Unsupported operand types: string << int
-Unsupported operand types: int << string
-Unsupported operand types: string << float
+TypeError: Unsupported operand types: float << resource
+TypeError: Unsupported operand types: resource << string
+TypeError: Unsupported operand types: string << resource
+TypeError: Unsupported operand types: resource << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << resource
+TypeError: Unsupported operand types: string << null
+TypeError: Unsupported operand types: null << string
+TypeError: Unsupported operand types: string << bool
+TypeError: Unsupported operand types: bool << string
+TypeError: Unsupported operand types: string << bool
+TypeError: Unsupported operand types: bool << string
+TypeError: Unsupported operand types: string << int
+TypeError: Unsupported operand types: int << string
+TypeError: Unsupported operand types: string << float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float << string
-Unsupported operand types: string << string
-Unsupported operand types: string << string
-Unsupported operand types: string << string
-Warning: A non-numeric value encountered
-Unsupported operand types: string << string
-Unsupported operand types: array >> array
-Unsupported operand types: array >> stdClass
-Unsupported operand types: array >> resource
-Unsupported operand types: array >> string
-Unsupported operand types: stdClass >> array
-Unsupported operand types: stdClass >> stdClass
-Unsupported operand types: stdClass >> resource
-Unsupported operand types: stdClass >> string
-Unsupported operand types: resource >> array
-Unsupported operand types: resource >> stdClass
-Unsupported operand types: resource >> resource
-Unsupported operand types: resource >> string
-Unsupported operand types: string >> array
-Unsupported operand types: string >> stdClass
-Unsupported operand types: string >> resource
-Unsupported operand types: string >> string
-Unsupported operand types: array >> null
-Unsupported operand types: null >> array
-Unsupported operand types: array >> bool
-Unsupported operand types: bool >> array
-Unsupported operand types: array >> bool
-Unsupported operand types: bool >> array
-Unsupported operand types: array >> int
-Unsupported operand types: int >> array
-Unsupported operand types: array >> float
+TypeError: Unsupported operand types: float << string
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: string << string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string << string
+TypeError: Unsupported operand types: array >> array
+TypeError: Unsupported operand types: array >> stdClass
+TypeError: Unsupported operand types: array >> resource
+TypeError: Unsupported operand types: array >> string
+TypeError: Unsupported operand types: stdClass >> array
+TypeError: Unsupported operand types: stdClass >> stdClass
+TypeError: Unsupported operand types: stdClass >> resource
+TypeError: Unsupported operand types: stdClass >> string
+TypeError: Unsupported operand types: resource >> array
+TypeError: Unsupported operand types: resource >> stdClass
+TypeError: Unsupported operand types: resource >> resource
+TypeError: Unsupported operand types: resource >> string
+TypeError: Unsupported operand types: string >> array
+TypeError: Unsupported operand types: string >> stdClass
+TypeError: Unsupported operand types: string >> resource
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: array >> null
+TypeError: Unsupported operand types: null >> array
+TypeError: Unsupported operand types: array >> bool
+TypeError: Unsupported operand types: bool >> array
+TypeError: Unsupported operand types: array >> bool
+TypeError: Unsupported operand types: bool >> array
+TypeError: Unsupported operand types: array >> int
+TypeError: Unsupported operand types: int >> array
+TypeError: Unsupported operand types: array >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> array
-Unsupported operand types: array >> string
-Unsupported operand types: string >> array
-Unsupported operand types: array >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> array
-Unsupported operand types: stdClass >> null
-Unsupported operand types: null >> stdClass
-Unsupported operand types: stdClass >> bool
-Unsupported operand types: bool >> stdClass
-Unsupported operand types: stdClass >> bool
-Unsupported operand types: bool >> stdClass
-Unsupported operand types: stdClass >> int
-Unsupported operand types: int >> stdClass
-Unsupported operand types: stdClass >> float
+TypeError: Unsupported operand types: float >> array
+TypeError: Unsupported operand types: array >> string
+TypeError: Unsupported operand types: string >> array
+TypeError: Unsupported operand types: array >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> array
+TypeError: Unsupported operand types: stdClass >> null
+TypeError: Unsupported operand types: null >> stdClass
+TypeError: Unsupported operand types: stdClass >> bool
+TypeError: Unsupported operand types: bool >> stdClass
+TypeError: Unsupported operand types: stdClass >> bool
+TypeError: Unsupported operand types: bool >> stdClass
+TypeError: Unsupported operand types: stdClass >> int
+TypeError: Unsupported operand types: int >> stdClass
+TypeError: Unsupported operand types: stdClass >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> stdClass
-Unsupported operand types: stdClass >> string
-Unsupported operand types: string >> stdClass
-Unsupported operand types: stdClass >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> stdClass
-Unsupported operand types: resource >> null
-Unsupported operand types: null >> resource
-Unsupported operand types: resource >> bool
-Unsupported operand types: bool >> resource
-Unsupported operand types: resource >> bool
-Unsupported operand types: bool >> resource
-Unsupported operand types: resource >> int
-Unsupported operand types: int >> resource
-Unsupported operand types: resource >> float
+TypeError: Unsupported operand types: float >> stdClass
+TypeError: Unsupported operand types: stdClass >> string
+TypeError: Unsupported operand types: string >> stdClass
+TypeError: Unsupported operand types: stdClass >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> stdClass
+TypeError: Unsupported operand types: resource >> null
+TypeError: Unsupported operand types: null >> resource
+TypeError: Unsupported operand types: resource >> bool
+TypeError: Unsupported operand types: bool >> resource
+TypeError: Unsupported operand types: resource >> bool
+TypeError: Unsupported operand types: bool >> resource
+TypeError: Unsupported operand types: resource >> int
+TypeError: Unsupported operand types: int >> resource
+TypeError: Unsupported operand types: resource >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> resource
-Unsupported operand types: resource >> string
-Unsupported operand types: string >> resource
-Unsupported operand types: resource >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> resource
-Unsupported operand types: string >> null
-Unsupported operand types: null >> string
-Unsupported operand types: string >> bool
-Unsupported operand types: bool >> string
-Unsupported operand types: string >> bool
-Unsupported operand types: bool >> string
-Unsupported operand types: string >> int
-Unsupported operand types: int >> string
-Unsupported operand types: string >> float
+TypeError: Unsupported operand types: float >> resource
+TypeError: Unsupported operand types: resource >> string
+TypeError: Unsupported operand types: string >> resource
+TypeError: Unsupported operand types: resource >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> resource
+TypeError: Unsupported operand types: string >> null
+TypeError: Unsupported operand types: null >> string
+TypeError: Unsupported operand types: string >> bool
+TypeError: Unsupported operand types: bool >> string
+TypeError: Unsupported operand types: string >> bool
+TypeError: Unsupported operand types: bool >> string
+TypeError: Unsupported operand types: string >> int
+TypeError: Unsupported operand types: int >> string
+TypeError: Unsupported operand types: string >> float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float >> string
-Unsupported operand types: string >> string
-Unsupported operand types: string >> string
-Unsupported operand types: string >> string
-Warning: A non-numeric value encountered
-Unsupported operand types: string >> string
-Unsupported operand types: array & array
-Unsupported operand types: array & stdClass
-Unsupported operand types: array & resource
-Unsupported operand types: array & string
-Unsupported operand types: stdClass & array
-Unsupported operand types: stdClass & stdClass
-Unsupported operand types: stdClass & resource
-Unsupported operand types: stdClass & string
-Unsupported operand types: resource & array
-Unsupported operand types: resource & stdClass
-Unsupported operand types: resource & resource
-Unsupported operand types: resource & string
-Unsupported operand types: string & array
-Unsupported operand types: string & stdClass
-Unsupported operand types: string & resource
+TypeError: Unsupported operand types: float >> string
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: string >> string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string >> string
+TypeError: Unsupported operand types: array & array
+TypeError: Unsupported operand types: array & stdClass
+TypeError: Unsupported operand types: array & resource
+TypeError: Unsupported operand types: array & string
+TypeError: Unsupported operand types: stdClass & array
+TypeError: Unsupported operand types: stdClass & stdClass
+TypeError: Unsupported operand types: stdClass & resource
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: resource & array
+TypeError: Unsupported operand types: resource & stdClass
+TypeError: Unsupported operand types: resource & resource
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: string & array
+TypeError: Unsupported operand types: string & stdClass
+TypeError: Unsupported operand types: string & resource
No error for "foo" &= "foo"
-Unsupported operand types: array & null
-Unsupported operand types: null & array
-Unsupported operand types: array & bool
-Unsupported operand types: bool & array
-Unsupported operand types: array & bool
-Unsupported operand types: bool & array
-Unsupported operand types: array & int
-Unsupported operand types: int & array
-Unsupported operand types: array & float
+TypeError: Unsupported operand types: array & null
+TypeError: Unsupported operand types: null & array
+TypeError: Unsupported operand types: array & bool
+TypeError: Unsupported operand types: bool & array
+TypeError: Unsupported operand types: array & bool
+TypeError: Unsupported operand types: bool & array
+TypeError: Unsupported operand types: array & int
+TypeError: Unsupported operand types: int & array
+TypeError: Unsupported operand types: array & float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float & array
-Unsupported operand types: array & string
-Unsupported operand types: string & array
-Unsupported operand types: array & string
-Warning: A non-numeric value encountered
-Unsupported operand types: string & array
-Unsupported operand types: stdClass & null
-Unsupported operand types: null & stdClass
-Unsupported operand types: stdClass & bool
-Unsupported operand types: bool & stdClass
-Unsupported operand types: stdClass & bool
-Unsupported operand types: bool & stdClass
-Unsupported operand types: stdClass & int
-Unsupported operand types: int & stdClass
-Unsupported operand types: stdClass & float
+TypeError: Unsupported operand types: float & array
+TypeError: Unsupported operand types: array & string
+TypeError: Unsupported operand types: string & array
+TypeError: Unsupported operand types: array & string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string & array
+TypeError: Unsupported operand types: stdClass & null
+TypeError: Unsupported operand types: null & stdClass
+TypeError: Unsupported operand types: stdClass & bool
+TypeError: Unsupported operand types: bool & stdClass
+TypeError: Unsupported operand types: stdClass & bool
+TypeError: Unsupported operand types: bool & stdClass
+TypeError: Unsupported operand types: stdClass & int
+TypeError: Unsupported operand types: int & stdClass
+TypeError: Unsupported operand types: stdClass & float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float & stdClass
-Unsupported operand types: stdClass & string
-Unsupported operand types: string & stdClass
-Unsupported operand types: stdClass & string
-Warning: A non-numeric value encountered
-Unsupported operand types: string & stdClass
-Unsupported operand types: resource & null
-Unsupported operand types: null & resource
-Unsupported operand types: resource & bool
-Unsupported operand types: bool & resource
-Unsupported operand types: resource & bool
-Unsupported operand types: bool & resource
-Unsupported operand types: resource & int
-Unsupported operand types: int & resource
-Unsupported operand types: resource & float
+TypeError: Unsupported operand types: float & stdClass
+TypeError: Unsupported operand types: stdClass & string
+TypeError: Unsupported operand types: string & stdClass
+TypeError: Unsupported operand types: stdClass & string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string & stdClass
+TypeError: Unsupported operand types: resource & null
+TypeError: Unsupported operand types: null & resource
+TypeError: Unsupported operand types: resource & bool
+TypeError: Unsupported operand types: bool & resource
+TypeError: Unsupported operand types: resource & bool
+TypeError: Unsupported operand types: bool & resource
+TypeError: Unsupported operand types: resource & int
+TypeError: Unsupported operand types: int & resource
+TypeError: Unsupported operand types: resource & float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float & resource
-Unsupported operand types: resource & string
-Unsupported operand types: string & resource
-Unsupported operand types: resource & string
-Warning: A non-numeric value encountered
-Unsupported operand types: string & resource
-Unsupported operand types: string & null
-Unsupported operand types: null & string
-Unsupported operand types: string & bool
-Unsupported operand types: bool & string
-Unsupported operand types: string & bool
-Unsupported operand types: bool & string
-Unsupported operand types: string & int
-Unsupported operand types: int & string
-Unsupported operand types: string & float
+TypeError: Unsupported operand types: float & resource
+TypeError: Unsupported operand types: resource & string
+TypeError: Unsupported operand types: string & resource
+TypeError: Unsupported operand types: resource & string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string & resource
+TypeError: Unsupported operand types: string & null
+TypeError: Unsupported operand types: null & string
+TypeError: Unsupported operand types: string & bool
+TypeError: Unsupported operand types: bool & string
+TypeError: Unsupported operand types: string & bool
+TypeError: Unsupported operand types: bool & string
+TypeError: Unsupported operand types: string & int
+TypeError: Unsupported operand types: int & string
+TypeError: Unsupported operand types: string & float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float & string
+TypeError: Unsupported operand types: float & string
No error for "foo" &= "123"
No error for "123" &= "foo"
No error for "foo" &= "123foo"
No error for "123foo" &= "foo"
-Unsupported operand types: array | array
-Unsupported operand types: array | stdClass
-Unsupported operand types: array | resource
-Unsupported operand types: array | string
-Unsupported operand types: stdClass | array
-Unsupported operand types: stdClass | stdClass
-Unsupported operand types: stdClass | resource
-Unsupported operand types: stdClass | string
-Unsupported operand types: resource | array
-Unsupported operand types: resource | stdClass
-Unsupported operand types: resource | resource
-Unsupported operand types: resource | string
-Unsupported operand types: string | array
-Unsupported operand types: string | stdClass
-Unsupported operand types: string | resource
+TypeError: Unsupported operand types: array | array
+TypeError: Unsupported operand types: array | stdClass
+TypeError: Unsupported operand types: array | resource
+TypeError: Unsupported operand types: array | string
+TypeError: Unsupported operand types: stdClass | array
+TypeError: Unsupported operand types: stdClass | stdClass
+TypeError: Unsupported operand types: stdClass | resource
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: resource | array
+TypeError: Unsupported operand types: resource | stdClass
+TypeError: Unsupported operand types: resource | resource
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: string | array
+TypeError: Unsupported operand types: string | stdClass
+TypeError: Unsupported operand types: string | resource
No error for "foo" |= "foo"
-Unsupported operand types: array | null
-Unsupported operand types: null | array
-Unsupported operand types: array | bool
-Unsupported operand types: bool | array
-Unsupported operand types: array | bool
-Unsupported operand types: bool | array
-Unsupported operand types: array | int
-Unsupported operand types: int | array
-Unsupported operand types: array | float
+TypeError: Unsupported operand types: array | null
+TypeError: Unsupported operand types: null | array
+TypeError: Unsupported operand types: array | bool
+TypeError: Unsupported operand types: bool | array
+TypeError: Unsupported operand types: array | bool
+TypeError: Unsupported operand types: bool | array
+TypeError: Unsupported operand types: array | int
+TypeError: Unsupported operand types: int | array
+TypeError: Unsupported operand types: array | float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float | array
-Unsupported operand types: array | string
-Unsupported operand types: string | array
-Unsupported operand types: array | string
-Warning: A non-numeric value encountered
-Unsupported operand types: string | array
-Unsupported operand types: stdClass | null
-Unsupported operand types: null | stdClass
-Unsupported operand types: stdClass | bool
-Unsupported operand types: bool | stdClass
-Unsupported operand types: stdClass | bool
-Unsupported operand types: bool | stdClass
-Unsupported operand types: stdClass | int
-Unsupported operand types: int | stdClass
-Unsupported operand types: stdClass | float
+TypeError: Unsupported operand types: float | array
+TypeError: Unsupported operand types: array | string
+TypeError: Unsupported operand types: string | array
+TypeError: Unsupported operand types: array | string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string | array
+TypeError: Unsupported operand types: stdClass | null
+TypeError: Unsupported operand types: null | stdClass
+TypeError: Unsupported operand types: stdClass | bool
+TypeError: Unsupported operand types: bool | stdClass
+TypeError: Unsupported operand types: stdClass | bool
+TypeError: Unsupported operand types: bool | stdClass
+TypeError: Unsupported operand types: stdClass | int
+TypeError: Unsupported operand types: int | stdClass
+TypeError: Unsupported operand types: stdClass | float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float | stdClass
-Unsupported operand types: stdClass | string
-Unsupported operand types: string | stdClass
-Unsupported operand types: stdClass | string
-Warning: A non-numeric value encountered
-Unsupported operand types: string | stdClass
-Unsupported operand types: resource | null
-Unsupported operand types: null | resource
-Unsupported operand types: resource | bool
-Unsupported operand types: bool | resource
-Unsupported operand types: resource | bool
-Unsupported operand types: bool | resource
-Unsupported operand types: resource | int
-Unsupported operand types: int | resource
-Unsupported operand types: resource | float
+TypeError: Unsupported operand types: float | stdClass
+TypeError: Unsupported operand types: stdClass | string
+TypeError: Unsupported operand types: string | stdClass
+TypeError: Unsupported operand types: stdClass | string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string | stdClass
+TypeError: Unsupported operand types: resource | null
+TypeError: Unsupported operand types: null | resource
+TypeError: Unsupported operand types: resource | bool
+TypeError: Unsupported operand types: bool | resource
+TypeError: Unsupported operand types: resource | bool
+TypeError: Unsupported operand types: bool | resource
+TypeError: Unsupported operand types: resource | int
+TypeError: Unsupported operand types: int | resource
+TypeError: Unsupported operand types: resource | float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float | resource
-Unsupported operand types: resource | string
-Unsupported operand types: string | resource
-Unsupported operand types: resource | string
-Warning: A non-numeric value encountered
-Unsupported operand types: string | resource
-Unsupported operand types: string | null
-Unsupported operand types: null | string
-Unsupported operand types: string | bool
-Unsupported operand types: bool | string
-Unsupported operand types: string | bool
-Unsupported operand types: bool | string
-Unsupported operand types: string | int
-Unsupported operand types: int | string
-Unsupported operand types: string | float
+TypeError: Unsupported operand types: float | resource
+TypeError: Unsupported operand types: resource | string
+TypeError: Unsupported operand types: string | resource
+TypeError: Unsupported operand types: resource | string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string | resource
+TypeError: Unsupported operand types: string | null
+TypeError: Unsupported operand types: null | string
+TypeError: Unsupported operand types: string | bool
+TypeError: Unsupported operand types: bool | string
+TypeError: Unsupported operand types: string | bool
+TypeError: Unsupported operand types: bool | string
+TypeError: Unsupported operand types: string | int
+TypeError: Unsupported operand types: int | string
+TypeError: Unsupported operand types: string | float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float | string
+TypeError: Unsupported operand types: float | string
No error for "foo" |= "123"
No error for "123" |= "foo"
No error for "foo" |= "123foo"
No error for "123foo" |= "foo"
-Unsupported operand types: array ^ array
-Unsupported operand types: array ^ stdClass
-Unsupported operand types: array ^ resource
-Unsupported operand types: array ^ string
-Unsupported operand types: stdClass ^ array
-Unsupported operand types: stdClass ^ stdClass
-Unsupported operand types: stdClass ^ resource
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: resource ^ array
-Unsupported operand types: resource ^ stdClass
-Unsupported operand types: resource ^ resource
-Unsupported operand types: resource ^ string
-Unsupported operand types: string ^ array
-Unsupported operand types: string ^ stdClass
-Unsupported operand types: string ^ resource
+TypeError: Unsupported operand types: array ^ array
+TypeError: Unsupported operand types: array ^ stdClass
+TypeError: Unsupported operand types: array ^ resource
+TypeError: Unsupported operand types: array ^ string
+TypeError: Unsupported operand types: stdClass ^ array
+TypeError: Unsupported operand types: stdClass ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ resource
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: resource ^ array
+TypeError: Unsupported operand types: resource ^ stdClass
+TypeError: Unsupported operand types: resource ^ resource
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: string ^ array
+TypeError: Unsupported operand types: string ^ stdClass
+TypeError: Unsupported operand types: string ^ resource
No error for "foo" ^= "foo"
-Unsupported operand types: array ^ null
-Unsupported operand types: null ^ array
-Unsupported operand types: array ^ bool
-Unsupported operand types: bool ^ array
-Unsupported operand types: array ^ bool
-Unsupported operand types: bool ^ array
-Unsupported operand types: array ^ int
-Unsupported operand types: int ^ array
-Unsupported operand types: array ^ float
+TypeError: Unsupported operand types: array ^ null
+TypeError: Unsupported operand types: null ^ array
+TypeError: Unsupported operand types: array ^ bool
+TypeError: Unsupported operand types: bool ^ array
+TypeError: Unsupported operand types: array ^ bool
+TypeError: Unsupported operand types: bool ^ array
+TypeError: Unsupported operand types: array ^ int
+TypeError: Unsupported operand types: int ^ array
+TypeError: Unsupported operand types: array ^ float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float ^ array
-Unsupported operand types: array ^ string
-Unsupported operand types: string ^ array
-Unsupported operand types: array ^ string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ^ array
-Unsupported operand types: stdClass ^ null
-Unsupported operand types: null ^ stdClass
-Unsupported operand types: stdClass ^ bool
-Unsupported operand types: bool ^ stdClass
-Unsupported operand types: stdClass ^ bool
-Unsupported operand types: bool ^ stdClass
-Unsupported operand types: stdClass ^ int
-Unsupported operand types: int ^ stdClass
-Unsupported operand types: stdClass ^ float
+TypeError: Unsupported operand types: float ^ array
+TypeError: Unsupported operand types: array ^ string
+TypeError: Unsupported operand types: string ^ array
+TypeError: Unsupported operand types: array ^ string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ^ array
+TypeError: Unsupported operand types: stdClass ^ null
+TypeError: Unsupported operand types: null ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ bool
+TypeError: Unsupported operand types: bool ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ bool
+TypeError: Unsupported operand types: bool ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ int
+TypeError: Unsupported operand types: int ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float ^ stdClass
-Unsupported operand types: stdClass ^ string
-Unsupported operand types: string ^ stdClass
-Unsupported operand types: stdClass ^ string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ^ stdClass
-Unsupported operand types: resource ^ null
-Unsupported operand types: null ^ resource
-Unsupported operand types: resource ^ bool
-Unsupported operand types: bool ^ resource
-Unsupported operand types: resource ^ bool
-Unsupported operand types: bool ^ resource
-Unsupported operand types: resource ^ int
-Unsupported operand types: int ^ resource
-Unsupported operand types: resource ^ float
+TypeError: Unsupported operand types: float ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ string
+TypeError: Unsupported operand types: string ^ stdClass
+TypeError: Unsupported operand types: stdClass ^ string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ^ stdClass
+TypeError: Unsupported operand types: resource ^ null
+TypeError: Unsupported operand types: null ^ resource
+TypeError: Unsupported operand types: resource ^ bool
+TypeError: Unsupported operand types: bool ^ resource
+TypeError: Unsupported operand types: resource ^ bool
+TypeError: Unsupported operand types: bool ^ resource
+TypeError: Unsupported operand types: resource ^ int
+TypeError: Unsupported operand types: int ^ resource
+TypeError: Unsupported operand types: resource ^ float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float ^ resource
-Unsupported operand types: resource ^ string
-Unsupported operand types: string ^ resource
-Unsupported operand types: resource ^ string
-Warning: A non-numeric value encountered
-Unsupported operand types: string ^ resource
-Unsupported operand types: string ^ null
-Unsupported operand types: null ^ string
-Unsupported operand types: string ^ bool
-Unsupported operand types: bool ^ string
-Unsupported operand types: string ^ bool
-Unsupported operand types: bool ^ string
-Unsupported operand types: string ^ int
-Unsupported operand types: int ^ string
-Unsupported operand types: string ^ float
+TypeError: Unsupported operand types: float ^ resource
+TypeError: Unsupported operand types: resource ^ string
+TypeError: Unsupported operand types: string ^ resource
+TypeError: Unsupported operand types: resource ^ string
+Warning: A non-numeric value encountered
+TypeError: Unsupported operand types: string ^ resource
+TypeError: Unsupported operand types: string ^ null
+TypeError: Unsupported operand types: null ^ string
+TypeError: Unsupported operand types: string ^ bool
+TypeError: Unsupported operand types: bool ^ string
+TypeError: Unsupported operand types: string ^ bool
+TypeError: Unsupported operand types: bool ^ string
+TypeError: Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: int ^ string
+TypeError: Unsupported operand types: string ^ float
Warning: Implicit conversion from float 3.5 to int loses precision
-Unsupported operand types: float ^ string
+TypeError: Unsupported operand types: float ^ string
No error for "foo" ^= "123"
No error for "123" ^= "foo"
No error for "foo" ^= "123foo"
@@ -1999,23 +1999,23 @@ Warning: Array to string conversion
Warning: Array to string conversion
No error for [] .= []
Warning: Array to string conversion
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
Warning: Array to string conversion
No error for [] .= STDOUT
Warning: Array to string conversion
No error for [] .= "foo"
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
Warning: Array to string conversion
No error for STDOUT .= []
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
No error for STDOUT .= STDOUT
No error for STDOUT .= "foo"
Warning: Array to string conversion
No error for "foo" .= []
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
No error for "foo" .= STDOUT
No error for "foo" .= "foo"
Warning: Array to string conversion
@@ -2046,20 +2046,20 @@ Warning: Array to string conversion
No error for [] .= "123foo"
Warning: Array to string conversion
No error for "123foo" .= []
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
No error for STDOUT .= null
No error for null .= STDOUT
No error for STDOUT .= true
@@ -2091,19 +2091,19 @@ No error for "123foo" .= "foo"
UNARY OP:
-Cannot perform bitwise not on array
-Cannot perform bitwise not on stdClass
-Cannot perform bitwise not on resource
+TypeError: Cannot perform bitwise not on array
+TypeError: Cannot perform bitwise not on stdClass
+TypeError: Cannot perform bitwise not on resource
No error for ~"foo"
INCDEC:
-Cannot increment array
-Cannot decrement array
-Cannot increment stdClass
-Cannot decrement stdClass
-Cannot increment resource
-Cannot decrement resource
+TypeError: Cannot increment array
+TypeError: Cannot decrement array
+TypeError: Cannot increment stdClass
+TypeError: Cannot decrement stdClass
+TypeError: Cannot increment resource
+TypeError: Cannot decrement resource
Warning: Increment on non-numeric string is deprecated, use str_increment() instead
No error for fop++
Warning: Decrement on non-numeric string has no effect and is deprecated
diff --git a/Zend/tests/oss_fuzz_434346548.phpt b/Zend/tests/oss_fuzz_434346548.phpt
index 139e36758bc4..fddea7f19640 100644
--- a/Zend/tests/oss_fuzz_434346548.phpt
+++ b/Zend/tests/oss_fuzz_434346548.phpt
@@ -14,9 +14,9 @@ function test($y = new Foo() < "") {
try {
test();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Foo::__toString(): Return value must be of type string, none returned
+TypeError: Foo::__toString(): Return value must be of type string, none returned
diff --git a/Zend/tests/pipe_operator/ast.phpt b/Zend/tests/pipe_operator/ast.phpt
index e8c088dabfdb..e6071d4885f7 100644
--- a/Zend/tests/pipe_operator/ast.phpt
+++ b/Zend/tests/pipe_operator/ast.phpt
@@ -8,37 +8,37 @@ print "Concat, which binds higher\n";
try {
assert(false && foo() . bar() |> baz() . quux());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && (foo() . bar()) |> baz() . quux());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && foo() . (bar() |> baz()) . quux());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && foo() . bar() |> (baz() . quux()));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && (foo() . bar() |> baz()) . quux());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && foo() . (bar() |> baz() . quux()));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
print "<, which binds lower\n";
@@ -46,37 +46,37 @@ print "<, which binds lower\n";
try {
assert(false && foo() < bar() |> baz());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && (foo() < bar()) |> baz());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && foo() < (bar() |> baz()));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && foo() |> bar() < baz());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && (foo() |> bar()) < baz());
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
assert(false && foo() |> (bar() < baz()));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
@@ -86,24 +86,24 @@ print "misc examples\n";
try {
assert(false && foo() |> (bar() |> baz(...)));
} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Concat, which binds higher
-assert(false && foo() . bar() |> baz() . quux())
-assert(false && foo() . bar() |> baz() . quux())
-assert(false && foo() . (bar() |> baz()) . quux())
-assert(false && foo() . bar() |> baz() . quux())
-assert(false && (foo() . bar() |> baz()) . quux())
-assert(false && foo() . (bar() |> baz() . quux()))
+AssertionError: assert(false && foo() . bar() |> baz() . quux())
+AssertionError: assert(false && foo() . bar() |> baz() . quux())
+AssertionError: assert(false && foo() . (bar() |> baz()) . quux())
+AssertionError: assert(false && foo() . bar() |> baz() . quux())
+AssertionError: assert(false && (foo() . bar() |> baz()) . quux())
+AssertionError: assert(false && foo() . (bar() |> baz() . quux()))
<, which binds lower
-assert(false && foo() < bar() |> baz())
-assert(false && (foo() < bar()) |> baz())
-assert(false && foo() < bar() |> baz())
-assert(false && foo() |> bar() < baz())
-assert(false && foo() |> bar() < baz())
-assert(false && foo() |> (bar() < baz()))
+AssertionError: assert(false && foo() < bar() |> baz())
+AssertionError: assert(false && (foo() < bar()) |> baz())
+AssertionError: assert(false && foo() < bar() |> baz())
+AssertionError: assert(false && foo() |> bar() < baz())
+AssertionError: assert(false && foo() |> bar() < baz())
+AssertionError: assert(false && foo() |> (bar() < baz()))
misc examples
-assert(false && foo() |> (bar() |> baz(...)))
+AssertionError: assert(false && foo() |> (bar() |> baz(...)))
diff --git a/Zend/tests/pipe_operator/call_by_ref.phpt b/Zend/tests/pipe_operator/call_by_ref.phpt
index 026089b0a654..869b6072f035 100644
--- a/Zend/tests/pipe_operator/call_by_ref.phpt
+++ b/Zend/tests/pipe_operator/call_by_ref.phpt
@@ -18,7 +18,7 @@ try {
$res1 = $a |> _modify(...);
var_dump($res1);
} catch (\Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
// Complex variables.
@@ -27,11 +27,11 @@ try {
$res2 = $a |> _append(...);
var_dump($res2);
} catch (\Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-_modify(): Argument #1 ($a) could not be passed by reference
-_append(): Argument #1 ($a) could not be passed by reference
+Error: _modify(): Argument #1 ($a) could not be passed by reference
+Error: _append(): Argument #1 ($a) could not be passed by reference
diff --git a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
index 31750ac280d7..529014fafe21 100644
--- a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
+++ b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
@@ -9,7 +9,7 @@ try {
$r = $a |> array_multisort(...);
var_dump($r);
} catch (\Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/pipe_operator/exception_interruption.phpt b/Zend/tests/pipe_operator/exception_interruption.phpt
index 6711b652e7c6..cb028e8a3e2f 100644
--- a/Zend/tests/pipe_operator/exception_interruption.phpt
+++ b/Zend/tests/pipe_operator/exception_interruption.phpt
@@ -14,7 +14,7 @@ try {
|> var_dump(...);
}
catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
@@ -24,7 +24,7 @@ try {
|> var_dump(...);
}
catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/pipe_operator/function_not_found.phpt b/Zend/tests/pipe_operator/function_not_found.phpt
index 747f53ce3e3d..a7370d7a8dfa 100644
--- a/Zend/tests/pipe_operator/function_not_found.phpt
+++ b/Zend/tests/pipe_operator/function_not_found.phpt
@@ -7,7 +7,7 @@ try {
$res1 = 5 |> '_test';
}
catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
index 2ecfbab6348f..4d65ebbae460 100644
--- a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
+++ b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
@@ -6,21 +6,21 @@ OSS-Fuzz #427814452
try {
false |> assert(...);
} catch (\AssertionError $e) {
- echo $e::class, ": '", $e->getMessage(), "'\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
0 |> "assert"(...);
} catch (\AssertionError $e) {
- echo $e::class, ": '", $e->getMessage(), "'\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
false |> ("a"."ssert")(...);
} catch (\AssertionError $e) {
- echo $e::class, ": '", $e->getMessage(), "'\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-AssertionError: ''
-AssertionError: ''
-AssertionError: ''
+AssertionError:
+AssertionError:
+AssertionError:
diff --git a/Zend/tests/pipe_operator/prec_005.phpt b/Zend/tests/pipe_operator/prec_005.phpt
index 0dd262324e3d..4d15a93dec77 100644
--- a/Zend/tests/pipe_operator/prec_005.phpt
+++ b/Zend/tests/pipe_operator/prec_005.phpt
@@ -6,9 +6,9 @@ Pipe precedence 005
try {
assert(false && 1 |> (fn() => 2));
} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && 1 |> (fn() => 2))
+AssertionError: assert(false && 1 |> (fn() => 2))
diff --git a/Zend/tests/pipe_operator/too_many_parameters.phpt b/Zend/tests/pipe_operator/too_many_parameters.phpt
index b36046bde05c..ef727952ca2d 100644
--- a/Zend/tests/pipe_operator/too_many_parameters.phpt
+++ b/Zend/tests/pipe_operator/too_many_parameters.phpt
@@ -12,7 +12,7 @@ try {
$res1 = 5 |> '_test';
}
catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
diff --git a/Zend/tests/pipe_operator/type_mismatch.phpt b/Zend/tests/pipe_operator/type_mismatch.phpt
index 2cee15bb47a0..3a2fe1371a3c 100644
--- a/Zend/tests/pipe_operator/type_mismatch.phpt
+++ b/Zend/tests/pipe_operator/type_mismatch.phpt
@@ -12,7 +12,7 @@ try {
var_dump($res1);
}
catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/pipe_operator/void_return.phpt b/Zend/tests/pipe_operator/void_return.phpt
index 0dbba519297c..e7d463eb0335 100644
--- a/Zend/tests/pipe_operator/void_return.phpt
+++ b/Zend/tests/pipe_operator/void_return.phpt
@@ -13,7 +13,7 @@ try {
var_dump($result);
}
catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
diff --git a/Zend/tests/pow_array_leak.phpt b/Zend/tests/pow_array_leak.phpt
index 06dce0ac6a2b..f6c40ad239a6 100644
--- a/Zend/tests/pow_array_leak.phpt
+++ b/Zend/tests/pow_array_leak.phpt
@@ -7,7 +7,7 @@ $x = [0];
try {
$x **= 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($x);
@@ -15,18 +15,18 @@ $x = [0];
try {
$x **= $x;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($x);
?>
--EXPECT--
-Unsupported operand types: array ** int
+TypeError: Unsupported operand types: array ** int
array(1) {
[0]=>
int(0)
}
-Unsupported operand types: array ** array
+TypeError: Unsupported operand types: array ** array
array(1) {
[0]=>
int(0)
diff --git a/Zend/tests/prop_const_expr/non_enums_rhs.phpt b/Zend/tests/prop_const_expr/non_enums_rhs.phpt
index 0bffe9d8e02f..c5605c2ffdb9 100644
--- a/Zend/tests/prop_const_expr/non_enums_rhs.phpt
+++ b/Zend/tests/prop_const_expr/non_enums_rhs.phpt
@@ -13,7 +13,7 @@ function test() {
try {
foo();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -22,5 +22,5 @@ test();
?>
--EXPECT--
-Fetching properties on non-enums in constant expressions is not allowed
-Fetching properties on non-enums in constant expressions is not allowed
+Error: Fetching properties on non-enums in constant expressions is not allowed
+Error: Fetching properties on non-enums in constant expressions is not allowed
diff --git a/Zend/tests/property_access_errors_for_guarded_properties.phpt b/Zend/tests/property_access_errors_for_guarded_properties.phpt
index 0a360a9447d7..c483c56f2e8e 100644
--- a/Zend/tests/property_access_errors_for_guarded_properties.phpt
+++ b/Zend/tests/property_access_errors_for_guarded_properties.phpt
@@ -35,21 +35,21 @@ $test = new Test;
try {
$test->prop = "bar";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access private property Test::$prop
-Cannot access private property Test::$prop
-Cannot access private property Test::$prop
+Error: Cannot access private property Test::$prop
+Error: Cannot access private property Test::$prop
+Error: Cannot access private property Test::$prop
diff --git a/Zend/tests/property_exists_basic.phpt b/Zend/tests/property_exists_basic.phpt
index 8412699e026b..964514a37692 100644
--- a/Zend/tests/property_exists_basic.phpt
+++ b/Zend/tests/property_exists_basic.phpt
@@ -43,27 +43,27 @@ var_dump(property_exists($foo,""));
try {
var_dump(property_exists(array(), "test"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(property_exists(1, "test"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(property_exists(3.14, "test"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(property_exists(true, "test"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(property_exists(null, "test"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$foo->bar();
@@ -86,11 +86,11 @@ bool(true)
bool(true)
bool(false)
bool(false)
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
-property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
+TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
bool(true)
bool(true)
bool(true)
diff --git a/Zend/tests/property_hooks/ast_printing.phpt b/Zend/tests/property_hooks/ast_printing.phpt
index 128a84964016..8053685f686f 100644
--- a/Zend/tests/property_hooks/ast_printing.phpt
+++ b/Zend/tests/property_hooks/ast_printing.phpt
@@ -20,12 +20,12 @@ try {
}
});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
public $prop1 {
get;
set;
diff --git a/Zend/tests/property_hooks/backed_delegated_read_write.phpt b/Zend/tests/property_hooks/backed_delegated_read_write.phpt
index df85768fe516..712cedf3ffd3 100644
--- a/Zend/tests/property_hooks/backed_delegated_read_write.phpt
+++ b/Zend/tests/property_hooks/backed_delegated_read_write.phpt
@@ -46,13 +46,13 @@ $test = new Test;
try {
$test->prop = 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$child = new Child();
@@ -61,6 +61,6 @@ var_dump($child->prop2);
?>
--EXPECTF--
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
int(43)
diff --git a/Zend/tests/property_hooks/bug001.phpt b/Zend/tests/property_hooks/bug001.phpt
index 62291019b333..8fc591222802 100644
--- a/Zend/tests/property_hooks/bug001.phpt
+++ b/Zend/tests/property_hooks/bug001.phpt
@@ -21,10 +21,10 @@ $c = new C;
try {
$c->x = 3;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
-Cannot write to get-only virtual property C::$x
+Error: Cannot write to get-only virtual property C::$x
diff --git a/Zend/tests/property_hooks/cache.phpt b/Zend/tests/property_hooks/cache.phpt
index dedbfa48f4ac..5fe6f6b09d36 100644
--- a/Zend/tests/property_hooks/cache.phpt
+++ b/Zend/tests/property_hooks/cache.phpt
@@ -19,14 +19,14 @@ function doTest(Test $test) {
try {
$test->prop[] = 1;
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
isset($test->prop);
isset($test->prop[0]);
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -46,10 +46,10 @@ Test::$prop::get
Test::$prop::set
Test::$prop::set
Test::$prop::get
-Indirect modification of Test::$prop is not allowed
+Error: Indirect modification of Test::$prop is not allowed
Test::$prop::get
Test::$prop::get
-Cannot unset hooked property Test::$prop
+Error: Cannot unset hooked property Test::$prop
Test::$prop::set
Test::$prop::get
@@ -58,7 +58,7 @@ Test::$prop::get
Test::$prop::set
Test::$prop::set
Test::$prop::get
-Indirect modification of Test::$prop is not allowed
+Error: Indirect modification of Test::$prop is not allowed
Test::$prop::get
Test::$prop::get
-Cannot unset hooked property Test::$prop
+Error: Cannot unset hooked property Test::$prop
diff --git a/Zend/tests/property_hooks/default_value_inheritance.phpt b/Zend/tests/property_hooks/default_value_inheritance.phpt
index 3821e19634e7..a6ceb29b9fca 100644
--- a/Zend/tests/property_hooks/default_value_inheritance.phpt
+++ b/Zend/tests/property_hooks/default_value_inheritance.phpt
@@ -29,13 +29,13 @@ function test(P $p) {
try {
var_dump($p->b);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($p->c);
try {
var_dump($p->d);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -45,10 +45,10 @@ test(new GC);
?>
--EXPECT--
NULL
-Typed property C::$b must not be accessed before initialization
+Error: Typed property C::$b must not be accessed before initialization
int(2)
int(2)
NULL
-Typed property GC::$b must not be accessed before initialization
+Error: Typed property GC::$b must not be accessed before initialization
NULL
-Typed property GC::$d must not be accessed before initialization
+Error: Typed property GC::$d must not be accessed before initialization
diff --git a/Zend/tests/property_hooks/direct_hook_call.phpt b/Zend/tests/property_hooks/direct_hook_call.phpt
index d97ef4c469a4..566d4b0efcc5 100644
--- a/Zend/tests/property_hooks/direct_hook_call.phpt
+++ b/Zend/tests/property_hooks/direct_hook_call.phpt
@@ -14,15 +14,15 @@ $test = new Test;
try {
$test->{'$prop::get'}();
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->{'$prop::set'}('foo');
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to undefined method Test::$prop::get()
-Call to undefined method Test::$prop::set()
+Error: Call to undefined method Test::$prop::get()
+Error: Call to undefined method Test::$prop::set()
diff --git a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
index 32aa1f27dc32..c82af2899446 100644
--- a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
+++ b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
@@ -7,11 +7,11 @@ try {
public function __construct(public final $prop) {}
});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
public function __construct(public final $prop) {
}
diff --git a/Zend/tests/property_hooks/foreach_val_to_ref.phpt b/Zend/tests/property_hooks/foreach_val_to_ref.phpt
index dba71412579f..220945409014 100644
--- a/Zend/tests/property_hooks/foreach_val_to_ref.phpt
+++ b/Zend/tests/property_hooks/foreach_val_to_ref.phpt
@@ -25,10 +25,10 @@ function test($object) {
try {
test(new ByVal);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
int(42)
-Cannot create reference to property ByVal::$byVal
+Error: Cannot create reference to property ByVal::$byVal
diff --git a/Zend/tests/property_hooks/get.phpt b/Zend/tests/property_hooks/get.phpt
index 6d4b005843ea..cc77227b2865 100644
--- a/Zend/tests/property_hooks/get.phpt
+++ b/Zend/tests/property_hooks/get.phpt
@@ -15,10 +15,10 @@ var_dump($test->prop);
try {
$test->prop = 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
int(42)
-Cannot write to get-only virtual property Test::$prop
+Error: Cannot write to get-only virtual property Test::$prop
diff --git a/Zend/tests/property_hooks/get_by_ref.phpt b/Zend/tests/property_hooks/get_by_ref.phpt
index f602721a791d..7bcd47f4ddc1 100644
--- a/Zend/tests/property_hooks/get_by_ref.phpt
+++ b/Zend/tests/property_hooks/get_by_ref.phpt
@@ -16,19 +16,19 @@ try {
$test->byVal = [];
$test->byVal[] = 42;
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->byVal);
try {
$test->byVal =& $ref;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Indirect modification of Test::$byVal is not allowed
+Error: Indirect modification of Test::$byVal is not allowed
array(0) {
}
-Cannot assign by reference to overloaded object
+Error: Cannot assign by reference to overloaded object
diff --git a/Zend/tests/property_hooks/get_by_ref_auto.phpt b/Zend/tests/property_hooks/get_by_ref_auto.phpt
index 0dabe4c45211..322e78d69998 100644
--- a/Zend/tests/property_hooks/get_by_ref_auto.phpt
+++ b/Zend/tests/property_hooks/get_by_ref_auto.phpt
@@ -12,14 +12,14 @@ $test = new Test;
try {
$test->byVal[] = 42;
} catch (\Error $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->byVal);
try {
$test->byVal =& $ref;
} catch (Error $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/property_hooks/get_type_check.phpt b/Zend/tests/property_hooks/get_type_check.phpt
index 2e0e9b9fcf6e..e9d54caccd2e 100644
--- a/Zend/tests/property_hooks/get_type_check.phpt
+++ b/Zend/tests/property_hooks/get_type_check.phpt
@@ -16,11 +16,11 @@ $test = new Test;
try {
var_dump($test->prop1);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop2);
?>
--EXPECT--
-Test::$prop1::get(): Return value must be of type int, string returned
+TypeError: Test::$prop1::get(): Return value must be of type int, string returned
int(42)
diff --git a/Zend/tests/property_hooks/gh15187_3.phpt b/Zend/tests/property_hooks/gh15187_3.phpt
index d82e6002f82b..712a8ba12b2d 100644
--- a/Zend/tests/property_hooks/gh15187_3.phpt
+++ b/Zend/tests/property_hooks/gh15187_3.phpt
@@ -18,7 +18,7 @@ foreach ($c as $k => &$v) {
try {
$v = 'foo';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
if ($k === 'd') {
@@ -31,7 +31,7 @@ var_dump($c);
?>
--EXPECTF--
int(1)
-Cannot assign string to reference held by property C::$c of type int
+TypeError: Cannot assign string to reference held by property C::$c of type int
int(2)
object(C)#%d (2) {
["b"]=>
diff --git a/Zend/tests/property_hooks/gh15644.phpt b/Zend/tests/property_hooks/gh15644.phpt
index 1e0dda3a0e44..360c557c7757 100644
--- a/Zend/tests/property_hooks/gh15644.phpt
+++ b/Zend/tests/property_hooks/gh15644.phpt
@@ -17,16 +17,16 @@ $c = new C();
try {
$c->prop1 = 'hello world';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->prop2 = 'hello world';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify private(set) property C::$prop1 from global scope
-Cannot modify private(set) property C::$prop2 from global scope
+Error: Cannot modify private(set) property C::$prop1 from global scope
+Error: Cannot modify private(set) property C::$prop2 from global scope
diff --git a/Zend/tests/property_hooks/gh16185_002.phpt b/Zend/tests/property_hooks/gh16185_002.phpt
index 39edba438b04..894edcc12148 100644
--- a/Zend/tests/property_hooks/gh16185_002.phpt
+++ b/Zend/tests/property_hooks/gh16185_002.phpt
@@ -22,9 +22,9 @@ $c->init();
try {
foreach ($c as &$prop) {}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Cannot acquire reference to readonly property C::$prop
+Error: Cannot acquire reference to readonly property C::$prop
diff --git a/Zend/tests/property_hooks/gh17101.phpt b/Zend/tests/property_hooks/gh17101.phpt
index 3ab53fb75da0..a4302971642b 100644
--- a/Zend/tests/property_hooks/gh17101.phpt
+++ b/Zend/tests/property_hooks/gh17101.phpt
@@ -8,12 +8,12 @@ try {
public function __construct( #[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1;} ) {}
});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
public function __construct(#[Foo] public private(set) bool $boolVal = false {
final set => $this->boolVal = 1;
}) {
diff --git a/Zend/tests/property_hooks/gh20270.phpt b/Zend/tests/property_hooks/gh20270.phpt
index 173d21990e55..a11bb0a1afcc 100644
--- a/Zend/tests/property_hooks/gh20270.phpt
+++ b/Zend/tests/property_hooks/gh20270.phpt
@@ -32,20 +32,20 @@ $b = new B();
try {
$b->prop1 = 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($b->prop1);
try {
$b->prop2 = 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($b->prop2);
?>
--EXPECT--
-Unknown named parameter $unknown
+Error: Unknown named parameter $unknown
int(42)
-Unknown named parameter $value
+Error: Unknown named parameter $value
int(42)
diff --git a/Zend/tests/property_hooks/indirect_modification.phpt b/Zend/tests/property_hooks/indirect_modification.phpt
index 2fb8bda77a24..e547579cec76 100644
--- a/Zend/tests/property_hooks/indirect_modification.phpt
+++ b/Zend/tests/property_hooks/indirect_modification.phpt
@@ -24,13 +24,13 @@ $test->byVal = [];
try {
$test->byVal[] = 1;
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->byVal);
try {
$ref =& $test->byVal;
} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ref = 42;
var_dump($test->byVal);
@@ -43,9 +43,9 @@ Test::$byVal::set
Test::$byVal::set
int(3)
Test::$byVal::set
-Indirect modification of Test::$byVal is not allowed
+Error: Indirect modification of Test::$byVal is not allowed
array(0) {
}
-Indirect modification of Test::$byVal is not allowed
+Error: Indirect modification of Test::$byVal is not allowed
array(0) {
}
diff --git a/Zend/tests/property_hooks/magic_interaction.phpt b/Zend/tests/property_hooks/magic_interaction.phpt
index 7ea9e60f8969..807899ef171d 100644
--- a/Zend/tests/property_hooks/magic_interaction.phpt
+++ b/Zend/tests/property_hooks/magic_interaction.phpt
@@ -19,7 +19,7 @@ class B extends A {
try {
$this->$name;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
public function __set($name, $value) {
@@ -27,7 +27,7 @@ class B extends A {
try {
$this->$name = $value;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
public function __isset($name) {
@@ -35,7 +35,7 @@ class B extends A {
try {
var_dump(isset($this->$name));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
public function __unset($name) {
@@ -50,7 +50,7 @@ $b->prop = 1;
try {
unset($b->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -59,4 +59,4 @@ A::$prop::get
A::$prop::get
bool(true)
A::$prop::set
-Cannot unset hooked property B::$prop
+Error: Cannot unset hooked property B::$prop
diff --git a/Zend/tests/property_hooks/override_add_get.phpt b/Zend/tests/property_hooks/override_add_get.phpt
index df2739e6086c..a4222ddaa350 100644
--- a/Zend/tests/property_hooks/override_add_get.phpt
+++ b/Zend/tests/property_hooks/override_add_get.phpt
@@ -21,7 +21,7 @@ $a->prop = 1;
try {
var_dump($a->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$b = new B;
@@ -31,7 +31,7 @@ var_dump($b->prop);
?>
--EXPECT--
A::A::$prop::set
-Cannot read from set-only virtual property A::$prop
+Error: Cannot read from set-only virtual property A::$prop
B::B::$prop::set
B::B::$prop::get
int(42)
diff --git a/Zend/tests/property_hooks/override_add_set.phpt b/Zend/tests/property_hooks/override_add_set.phpt
index e13de15f0b82..2a907a563bd8 100644
--- a/Zend/tests/property_hooks/override_add_set.phpt
+++ b/Zend/tests/property_hooks/override_add_set.phpt
@@ -20,7 +20,7 @@ $a = new A;
try {
$a->prop = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($a->prop);
@@ -30,7 +30,7 @@ var_dump($b->prop);
?>
--EXPECT--
-Cannot write to get-only virtual property A::$prop
+Error: Cannot write to get-only virtual property A::$prop
A::A::$prop::get
int(42)
B::B::$prop::set
diff --git a/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt b/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt
index 767e585f9199..6ac34a1c0a3b 100644
--- a/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt
+++ b/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt
@@ -13,9 +13,9 @@ $foo = new Foo();
try {
var_dump($foo->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot use "parent" when current class scope has no parent
+Error: Cannot use "parent" when current class scope has no parent
diff --git a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
index 0edd8ff074ef..6638b2911d29 100644
--- a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
+++ b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
@@ -17,9 +17,9 @@ $c = new C();
try {
var_dump($c->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Typed property C::$prop must not be accessed before initialization
+Error: Typed property C::$prop must not be accessed before initialization
diff --git a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
index 04ac779f607b..2ce345f6d1b7 100644
--- a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
+++ b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
@@ -19,9 +19,9 @@ $b = new B();
try {
var_dump($b->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-A::$prop::get() expects exactly 0 arguments, 1 given
+ArgumentCountError: A::$prop::get() expects exactly 0 arguments, 1 given
diff --git a/Zend/tests/property_hooks/parent_get_undefined_property.phpt b/Zend/tests/property_hooks/parent_get_undefined_property.phpt
index 388448963e3e..165e64470e61 100644
--- a/Zend/tests/property_hooks/parent_get_undefined_property.phpt
+++ b/Zend/tests/property_hooks/parent_get_undefined_property.phpt
@@ -17,9 +17,9 @@ $c = new C();
try {
var_dump($c->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined property P::$prop
+Error: Undefined property P::$prop
diff --git a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
index aa95552af563..544a5cbc4a55 100644
--- a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
+++ b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
@@ -19,9 +19,9 @@ $b = new B();
try {
$b->prop = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-A::$prop::set() expects exactly 1 argument, 2 given
+ArgumentCountError: A::$prop::set() expects exactly 1 argument, 2 given
diff --git a/Zend/tests/property_hooks/parent_superfluous_args.phpt b/Zend/tests/property_hooks/parent_superfluous_args.phpt
index 2abcd7e7d10d..8d46b7a3442e 100644
--- a/Zend/tests/property_hooks/parent_superfluous_args.phpt
+++ b/Zend/tests/property_hooks/parent_superfluous_args.phpt
@@ -35,17 +35,17 @@ var_dump($b->virtual);
try {
var_dump($b->backed = 42);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($b->backed);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
int(42)
NULL
-A::$backed::set() expects exactly 1 argument, 2 given
-A::$backed::get() expects exactly 0 arguments, 1 given
+ArgumentCountError: A::$backed::set() expects exactly 1 argument, 2 given
+ArgumentCountError: A::$backed::get() expects exactly 0 arguments, 1 given
diff --git a/Zend/tests/property_hooks/parent_wrong_property_info.phpt b/Zend/tests/property_hooks/parent_wrong_property_info.phpt
index c18aad7f11f9..6d7d30bcc73c 100644
--- a/Zend/tests/property_hooks/parent_wrong_property_info.phpt
+++ b/Zend/tests/property_hooks/parent_wrong_property_info.phpt
@@ -17,9 +17,9 @@ $b = new B;
try {
var_dump($b->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access private property A::$prop
+Error: Cannot access private property A::$prop
diff --git a/Zend/tests/property_hooks/read_sibling_backing_value.phpt b/Zend/tests/property_hooks/read_sibling_backing_value.phpt
index 65fe28fed32c..745fa768bb88 100644
--- a/Zend/tests/property_hooks/read_sibling_backing_value.phpt
+++ b/Zend/tests/property_hooks/read_sibling_backing_value.phpt
@@ -26,9 +26,9 @@ $test = new Test;
try {
var_dump($test->a);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/property_hooks/set.phpt b/Zend/tests/property_hooks/set.phpt
index 2928aee6cede..4c3a64d42464 100644
--- a/Zend/tests/property_hooks/set.phpt
+++ b/Zend/tests/property_hooks/set.phpt
@@ -17,16 +17,16 @@ var_dump($test->_prop);
try {
var_dump($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(isset($test->prop));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
int(42)
-Cannot read from set-only virtual property Test::$prop
-Cannot read from set-only virtual property Test::$prop
+Error: Cannot read from set-only virtual property Test::$prop
+Error: Cannot read from set-only virtual property Test::$prop
diff --git a/Zend/tests/property_hooks/unset.phpt b/Zend/tests/property_hooks/unset.phpt
index 49edd56831a0..794859c85ac9 100644
--- a/Zend/tests/property_hooks/unset.phpt
+++ b/Zend/tests/property_hooks/unset.phpt
@@ -19,11 +19,11 @@ $test->prop = 42;
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop);
?>
--EXPECT--
-Cannot unset hooked property Test::$prop
+Error: Cannot unset hooked property Test::$prop
int(42)
diff --git a/Zend/tests/property_hooks/virtual_read_write.phpt b/Zend/tests/property_hooks/virtual_read_write.phpt
index e5451ee1ceb5..a19255dfd527 100644
--- a/Zend/tests/property_hooks/virtual_read_write.phpt
+++ b/Zend/tests/property_hooks/virtual_read_write.phpt
@@ -34,16 +34,16 @@ $test = new Test;
try {
$test->prop = 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/readonly_classes/gh10377.phpt b/Zend/tests/readonly_classes/gh10377.phpt
index c9e902ae739d..0b907c98dacd 100644
--- a/Zend/tests/readonly_classes/gh10377.phpt
+++ b/Zend/tests/readonly_classes/gh10377.phpt
@@ -21,7 +21,7 @@ var_dump($readonly_anon->field);
try {
$readonly_anon->field = 123;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($readonly_anon->field);
@@ -29,14 +29,14 @@ var_dump($anon->field);
try {
$anon->field = 123;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($anon->field);
?>
--EXPECT--
int(2)
-Cannot modify readonly property class@anonymous::$field
+Error: Cannot modify readonly property class@anonymous::$field
int(2)
int(2)
int(123)
diff --git a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
index b4da25ab0fec..b422ca9c8812 100644
--- a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
@@ -12,9 +12,9 @@ $foo = new Foo();
try {
$foo->bar = 1;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot create dynamic property Foo::$bar
+Error: Cannot create dynamic property Foo::$bar
diff --git a/Zend/tests/readonly_classes/readonly_class_property1.phpt b/Zend/tests/readonly_classes/readonly_class_property1.phpt
index 34e09eecd7fc..70245b7cb386 100644
--- a/Zend/tests/readonly_classes/readonly_class_property1.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_property1.phpt
@@ -17,9 +17,9 @@ $foo = new Foo();
try {
$foo->bar = 2;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_classes/readonly_class_property2.phpt b/Zend/tests/readonly_classes/readonly_class_property2.phpt
index 6db08f4dfb38..c5e8e218fa3c 100644
--- a/Zend/tests/readonly_classes/readonly_class_property2.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_property2.phpt
@@ -15,9 +15,9 @@ $foo = new Foo(1);
try {
$foo->bar = 2;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
index e0672e4d97f8..94eb3e7ef318 100644
--- a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
@@ -8,9 +8,9 @@ readonly class C {}
try {
$readonly = unserialize('O:1:"C":1:{s:1:"x";b:1;}');
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot create dynamic property C::$x
+Error: Cannot create dynamic property C::$x
diff --git a/Zend/tests/readonly_props/array_append_initialization.phpt b/Zend/tests/readonly_props/array_append_initialization.phpt
index d9b3e8c07443..5d9ccdcaeb00 100644
--- a/Zend/tests/readonly_props/array_append_initialization.phpt
+++ b/Zend/tests/readonly_props/array_append_initialization.phpt
@@ -22,16 +22,16 @@ function init() {
try {
(new C)->init();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
init();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot indirectly modify readonly property C::$a
-Cannot indirectly modify readonly property C::$a
+Error: Cannot indirectly modify readonly property C::$a
+Error: Cannot indirectly modify readonly property C::$a
diff --git a/Zend/tests/readonly_props/by_ref_foreach.phpt b/Zend/tests/readonly_props/by_ref_foreach.phpt
index dfc1d1709371..ab48594ba0e2 100644
--- a/Zend/tests/readonly_props/by_ref_foreach.phpt
+++ b/Zend/tests/readonly_props/by_ref_foreach.phpt
@@ -21,9 +21,9 @@ $test->init();
try {
foreach ($test as &$prop) {}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot acquire reference to readonly property Test::$prop
+Error: Cannot acquire reference to readonly property Test::$prop
diff --git a/Zend/tests/readonly_props/cache_slot.phpt b/Zend/tests/readonly_props/cache_slot.phpt
index af7f73c36eb9..17a4ab057075 100644
--- a/Zend/tests/readonly_props/cache_slot.phpt
+++ b/Zend/tests/readonly_props/cache_slot.phpt
@@ -30,7 +30,7 @@ var_dump($test->prop);
try {
$test->setProp("b");
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop);
echo "\n";
@@ -39,12 +39,12 @@ $test = new Test;
try {
$test->initAndAppendProp2();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->initAndAppendProp2();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop2);
echo "\n";
@@ -66,12 +66,12 @@ $appendProp2 = (function() {
try {
$appendProp2();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$appendProp2();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop2);
echo "\n";
@@ -90,11 +90,11 @@ var_dump($test->prop3);
?>
--EXPECTF--
string(1) "a"
-Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
string(1) "a"
-Cannot indirectly modify readonly property Test::$prop2
-Cannot modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot modify readonly property Test::$prop2
array(0) {
}
@@ -107,8 +107,8 @@ object(stdClass)#%d (1) {
int(1)
}
-Cannot indirectly modify readonly property Test::$prop2
-Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
array(0) {
}
diff --git a/Zend/tests/readonly_props/gh7942.phpt b/Zend/tests/readonly_props/gh7942.phpt
index 89db53439a2f..1dba45252b0d 100644
--- a/Zend/tests/readonly_props/gh7942.phpt
+++ b/Zend/tests/readonly_props/gh7942.phpt
@@ -14,9 +14,9 @@ try {
$i = 42;
new Foo($i);
} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot indirectly modify readonly property Foo::$bar
+Error: Cannot indirectly modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/initialization_scope.phpt b/Zend/tests/readonly_props/initialization_scope.phpt
index 49a4341e138f..126f08acf284 100644
--- a/Zend/tests/readonly_props/initialization_scope.phpt
+++ b/Zend/tests/readonly_props/initialization_scope.phpt
@@ -20,7 +20,7 @@ $test = new B;
try {
$test->prop = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$test->initProtected();
var_dump($test);
@@ -59,7 +59,7 @@ var_dump($test);
?>
--EXPECTF--
-Cannot modify protected(set) readonly property A::$prop from global scope
+Error: Cannot modify protected(set) readonly property A::$prop from global scope
object(B)#%d (1) {
["prop"]=>
int(2)
diff --git a/Zend/tests/readonly_props/magic_get_set.phpt b/Zend/tests/readonly_props/magic_get_set.phpt
index ff9d7c7e3325..f56396da9cb7 100644
--- a/Zend/tests/readonly_props/magic_get_set.phpt
+++ b/Zend/tests/readonly_props/magic_get_set.phpt
@@ -36,17 +36,17 @@ var_dump(isset($test->prop));
try {
var_dump($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$test->unsetProp();
@@ -57,15 +57,15 @@ $test->prop = 2;
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(false)
-Typed property Test::$prop must not be accessed before initialization
-Cannot modify protected(set) readonly property Test::$prop from global scope
-Cannot unset protected(set) readonly property Test::$prop from global scope
+Error: Typed property Test::$prop must not be accessed before initialization
+Error: Cannot modify protected(set) readonly property Test::$prop from global scope
+Error: Cannot unset protected(set) readonly property Test::$prop from global scope
Test::__isset(prop)
bool(true)
Test::__get(prop)
diff --git a/Zend/tests/readonly_props/promotion.phpt b/Zend/tests/readonly_props/promotion.phpt
index ee83246083b3..2e4c23bbed70 100644
--- a/Zend/tests/readonly_props/promotion.phpt
+++ b/Zend/tests/readonly_props/promotion.phpt
@@ -16,7 +16,7 @@ $point = new Point(1.0, 2.0, 3.0);
try {
$point->x = 4.0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($point);
@@ -30,7 +30,7 @@ object(Point)#1 (3) {
["z"]=>
float(0)
}
-Cannot modify readonly property Point::$x
+Error: Cannot modify readonly property Point::$x
object(Point)#1 (3) {
["x"]=>
float(1)
diff --git a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
index 29218d837d7f..90c890688611 100644
--- a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
+++ b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
@@ -25,9 +25,9 @@ $foo = new Foo("");
try {
$foo->write();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_clone_error1.phpt b/Zend/tests/readonly_props/readonly_clone_error1.phpt
index 98829d175765..f4fc3e74cfe9 100644
--- a/Zend/tests/readonly_props/readonly_clone_error1.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error1.phpt
@@ -21,7 +21,7 @@ $foo = new Foo(1);
try {
clone $foo;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
echo "done";
@@ -32,5 +32,5 @@ object(Foo)#2 (1) {
["bar"]=>
int(2)
}
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
done
diff --git a/Zend/tests/readonly_props/readonly_clone_error2.phpt b/Zend/tests/readonly_props/readonly_clone_error2.phpt
index e1e42abad074..aa7a77c7c38b 100644
--- a/Zend/tests/readonly_props/readonly_clone_error2.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error2.phpt
@@ -27,16 +27,16 @@ $foo = new Foo(1, 1);
try {
$foo->wrongCloneOld();
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$foo->wrongCloneNew();
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property Foo::$bar
-Cannot modify readonly property Foo::$baz
+Error: Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$baz
diff --git a/Zend/tests/readonly_props/readonly_clone_error3.phpt b/Zend/tests/readonly_props/readonly_clone_error3.phpt
index a51ec165c68c..31e99180e155 100644
--- a/Zend/tests/readonly_props/readonly_clone_error3.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error3.phpt
@@ -29,16 +29,16 @@ $foo = new Foo(1, 1);
try {
$foo->wrongCloneOld();
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$foo->wrongCloneNew();
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property Foo::$bar
-Cannot modify readonly property Foo::$baz
+Error: Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$baz
diff --git a/Zend/tests/readonly_props/readonly_clone_error4.phpt b/Zend/tests/readonly_props/readonly_clone_error4.phpt
index f9edcbcbaa18..c47193f1e3b6 100644
--- a/Zend/tests/readonly_props/readonly_clone_error4.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error4.phpt
@@ -21,13 +21,13 @@ $foo = new Foo(1);
try {
clone $foo;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
clone $foo;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
@@ -36,9 +36,9 @@ object(Foo)#2 (1) {
["bar"]=>
int(3)
}
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
object(Foo)#2 (1) {
["bar"]=>
int(3)
}
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_clone_error5.phpt b/Zend/tests/readonly_props/readonly_clone_error5.phpt
index a6a10fb8a27c..eb934d738a2d 100644
--- a/Zend/tests/readonly_props/readonly_clone_error5.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error5.phpt
@@ -35,30 +35,30 @@ class TestSetTwice {
try {
var_dump(clone (new TestSetOnce()));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone (new TestSetOnce()));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone (new TestSetTwice()));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone (new TestSetTwice()));
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot indirectly modify readonly property TestSetOnce::$prop
-Cannot indirectly modify readonly property TestSetOnce::$prop
-Cannot indirectly modify readonly property TestSetTwice::$prop
-Cannot indirectly modify readonly property TestSetTwice::$prop
+Error: Cannot indirectly modify readonly property TestSetOnce::$prop
+Error: Cannot indirectly modify readonly property TestSetOnce::$prop
+Error: Cannot indirectly modify readonly property TestSetTwice::$prop
+Error: Cannot indirectly modify readonly property TestSetTwice::$prop
diff --git a/Zend/tests/readonly_props/readonly_clone_error6.phpt b/Zend/tests/readonly_props/readonly_clone_error6.phpt
index 16a04d802a11..ba63fecbb041 100644
--- a/Zend/tests/readonly_props/readonly_clone_error6.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error6.phpt
@@ -22,13 +22,13 @@ var_dump($foo);
try {
$foo->__clone();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$foo->__clone();
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo);
@@ -39,8 +39,8 @@ object(Foo)#%d (%d) {
["bar"]=>
int(0)
}
-Cannot modify readonly property Foo::$bar
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
object(Foo)#%d (%d) {
["bar"]=>
int(0)
diff --git a/Zend/tests/readonly_props/readonly_clone_error7.phpt b/Zend/tests/readonly_props/readonly_clone_error7.phpt
index e34ad9eb3d71..c653966dfc0a 100644
--- a/Zend/tests/readonly_props/readonly_clone_error7.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error7.phpt
@@ -19,15 +19,15 @@ $foo = new Foo([]);
try {
var_dump(clone $foo);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone $foo);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot indirectly modify readonly property Foo::$bar
-Cannot indirectly modify readonly property Foo::$bar
+Error: Cannot indirectly modify readonly property Foo::$bar
+Error: Cannot indirectly modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_clone_success4.phpt b/Zend/tests/readonly_props/readonly_clone_success4.phpt
index 40b7a29e3126..fea00e537046 100644
--- a/Zend/tests/readonly_props/readonly_clone_success4.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_success4.phpt
@@ -13,7 +13,7 @@ class Foo {
try {
$this->bar = "foo";
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$this->bar = 2;
@@ -27,12 +27,12 @@ var_dump(clone $foo);
?>
--EXPECTF--
-Cannot assign string to property Foo::$bar of type int
+TypeError: Cannot assign string to property Foo::$bar of type int
object(Foo)#%d (%d) {
["bar"]=>
int(2)
}
-Cannot assign string to property Foo::$bar of type int
+TypeError: Cannot assign string to property Foo::$bar of type int
object(Foo)#%d (%d) {
["bar"]=>
int(2)
diff --git a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
index d41211d8e998..ffe8411a2240 100644
--- a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
+++ b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
@@ -11,7 +11,7 @@ class Foo {
try {
$this->bar = 42;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -20,4 +20,4 @@ new Foo();
?>
--EXPECTF--
-Cannot modify readonly property Foo::$bar
+Error: Cannot modify readonly property Foo::$bar
diff --git a/Zend/tests/readonly_props/readonly_containing_object.phpt b/Zend/tests/readonly_props/readonly_containing_object.phpt
index 996b0ee3d44b..30b43619ecea 100644
--- a/Zend/tests/readonly_props/readonly_containing_object.phpt
+++ b/Zend/tests/readonly_props/readonly_containing_object.phpt
@@ -18,17 +18,17 @@ $test->prop->foo++;
try {
$test->prop += 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
--$test->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop);
@@ -44,9 +44,9 @@ var_dump($test->prop);
?>
--EXPECT--
-Unsupported operand types: stdClass + int
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
+TypeError: Unsupported operand types: stdClass + int
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
object(stdClass)#2 (1) {
["foo"]=>
int(3)
diff --git a/Zend/tests/readonly_props/readonly_modification.phpt b/Zend/tests/readonly_props/readonly_modification.phpt
index bd04a203be19..6d23fd1eecc8 100644
--- a/Zend/tests/readonly_props/readonly_modification.phpt
+++ b/Zend/tests/readonly_props/readonly_modification.phpt
@@ -21,62 +21,62 @@ var_dump($test->prop); // Read.
try {
$test->prop = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop += 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
++$test->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$ref =& $test->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop =& $ref;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
byRef($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop2); // Read.
try {
$test->prop2[] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2[0][] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
int(1)
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
-Cannot modify readonly property Test::$prop
-Cannot indirectly modify readonly property Test::$prop
-Cannot indirectly modify readonly property Test::$prop
-Cannot indirectly modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
+Error: Cannot indirectly modify readonly property Test::$prop
+Error: Cannot indirectly modify readonly property Test::$prop
+Error: Cannot indirectly modify readonly property Test::$prop
array(0) {
}
-Cannot indirectly modify readonly property Test::$prop2
-Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
+Error: Cannot indirectly modify readonly property Test::$prop2
diff --git a/Zend/tests/readonly_props/readonly_with_default.phpt b/Zend/tests/readonly_props/readonly_with_default.phpt
index 12afe5cde153..a68b2b73596a 100644
--- a/Zend/tests/readonly_props/readonly_with_default.phpt
+++ b/Zend/tests/readonly_props/readonly_with_default.phpt
@@ -11,7 +11,7 @@ $test = new Test;
try {
$test->prop = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/readonly_props/unset.phpt b/Zend/tests/readonly_props/unset.phpt
index b8bd4218fa0c..271cca24ad4d 100644
--- a/Zend/tests/readonly_props/unset.phpt
+++ b/Zend/tests/readonly_props/unset.phpt
@@ -15,7 +15,7 @@ $test = new Test(1);
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test2 {
@@ -40,7 +40,7 @@ var_dump($test->prop); // Don't call __get.
try {
unset($test->prop); // Unset initialized, illegal.
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test3 {
@@ -51,14 +51,14 @@ $test = new Test3;
try {
unset($test->prop);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot unset readonly property Test::$prop
+Error: Cannot unset readonly property Test::$prop
Test2::__get
int(1)
int(1)
-Cannot unset readonly property Test2::$prop
-Cannot unset protected(set) readonly property Test3::$prop from global scope
+Error: Cannot unset readonly property Test2::$prop
+Error: Cannot unset protected(set) readonly property Test3::$prop from global scope
diff --git a/Zend/tests/readonly_props/visibility_change.phpt b/Zend/tests/readonly_props/visibility_change.phpt
index f4a32f3cdaaf..aeeaa5de2b73 100644
--- a/Zend/tests/readonly_props/visibility_change.phpt
+++ b/Zend/tests/readonly_props/visibility_change.phpt
@@ -18,7 +18,7 @@ $a = new A();
try {
var_dump($a->prop);
} catch (Error $error) {
- echo $error->getMessage() . "\n";
+ echo $error::class, ': ', $error->getMessage(), "\n";
}
$b = new B();
@@ -26,5 +26,5 @@ var_dump($b->prop);
?>
--EXPECT--
-Cannot access protected property A::$prop
+Error: Cannot access protected property A::$prop
int(42)
diff --git a/Zend/tests/recursive_array_comparison.phpt b/Zend/tests/recursive_array_comparison.phpt
index 53cc9736030d..0a89f820f4f3 100644
--- a/Zend/tests/recursive_array_comparison.phpt
+++ b/Zend/tests/recursive_array_comparison.phpt
@@ -6,16 +6,16 @@ $a = [&$a];
try {
$a === [[]];
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
[[]] === $a;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($a === $a);
?>
--EXPECT--
-Nesting level too deep - recursive dependency?
-Nesting level too deep - recursive dependency?
+Error: Nesting level too deep - recursive dependency?
+Error: Nesting level too deep - recursive dependency?
bool(true)
diff --git a/Zend/tests/recv_init_ref_type.phpt b/Zend/tests/recv_init_ref_type.phpt
index 29b96d379f8d..343281249ba4 100644
--- a/Zend/tests/recv_init_ref_type.phpt
+++ b/Zend/tests/recv_init_ref_type.phpt
@@ -10,9 +10,9 @@ try {
$bar = 42;
test($bar);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d
diff --git a/Zend/tests/require_once_warning_to_exception.phpt b/Zend/tests/require_once_warning_to_exception.phpt
index bc706622438f..bf51df8e8e45 100644
--- a/Zend/tests/require_once_warning_to_exception.phpt
+++ b/Zend/tests/require_once_warning_to_exception.phpt
@@ -11,9 +11,9 @@ set_error_handler("exception_error_handler");
try {
$results = require_once 'does-not-exist.php';
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
};
?>
--EXPECT--
-require_once(): Failed to open stream: No such file or directory
+Exception: require_once(): Failed to open stream: No such file or directory
diff --git a/Zend/tests/require_parse_exception.phpt b/Zend/tests/require_parse_exception.phpt
index d64efe178671..2c6556e38b79 100644
--- a/Zend/tests/require_parse_exception.phpt
+++ b/Zend/tests/require_parse_exception.phpt
@@ -9,7 +9,7 @@ function test_parse_error($code) {
try {
require 'data://text/plain;base64,' . base64_encode($code);
} catch (ParseError $e) {
- echo $e->getMessage(), " on line ", $e->getLine(), "\n";
+ echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n";
}
}
@@ -43,9 +43,9 @@ var_dump("\u{ffffff}");');
?>
--EXPECT--
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
-Unclosed '{' on line 2
-Unclosed '{' on line 3
-syntax error, unexpected end of file, expecting "(" on line 2
-Invalid numeric literal on line 2
-Invalid UTF-8 codepoint escape sequence on line 2
-Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2
+ParseError: Unclosed '{' on line 2
+ParseError: Unclosed '{' on line 3
+ParseError: syntax error, unexpected end of file, expecting "(" on line 2
+ParseError: Invalid numeric literal on line 2
+ParseError: Invalid UTF-8 codepoint escape sequence on line 2
+ParseError: Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2
diff --git a/Zend/tests/required_param_after_optional_named_args.phpt b/Zend/tests/required_param_after_optional_named_args.phpt
index 19060ab108b0..f73014cc3661 100644
--- a/Zend/tests/required_param_after_optional_named_args.phpt
+++ b/Zend/tests/required_param_after_optional_named_args.phpt
@@ -8,10 +8,10 @@ function test($a = 1, $b) {
try {
test(b: 2);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: test(): Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in %s on line %d
-test(): Argument #1 ($a) not passed
+ArgumentCountError: test(): Argument #1 ($a) not passed
diff --git a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
index afb099b6812d..c1adf8749e38 100644
--- a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
+++ b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
@@ -7,17 +7,17 @@ function by_ref(&$ref) {}
try {
by_ref($GLOBALS);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
by_ref2($GLOBALS);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function by_ref2(&$ref) {}
?>
--EXPECT--
-by_ref(): Argument #1 ($ref) could not be passed by reference
-by_ref2(): Argument #1 ($ref) could not be passed by reference
+Error: by_ref(): Argument #1 ($ref) could not be passed by reference
+Error: by_ref2(): Argument #1 ($ref) could not be passed by reference
diff --git a/Zend/tests/return_types/028.phpt b/Zend/tests/return_types/028.phpt
index 802dd7708dfe..89a5cd502514 100644
--- a/Zend/tests/return_types/028.phpt
+++ b/Zend/tests/return_types/028.phpt
@@ -12,9 +12,9 @@ function foo(): stdClass {
try {
foo();
} catch (Error $e) {
- echo $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine();
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), PHP_EOL;
}
?>
--EXPECTF--
-foo(): Return value must be of type stdClass, array returned in %s on line %d
+TypeError: foo(): Return value must be of type stdClass, array returned in %s on line %d
diff --git a/Zend/tests/return_types/bug70557.phpt b/Zend/tests/return_types/bug70557.phpt
index 1795a2a26a79..5ce47d723b22 100644
--- a/Zend/tests/return_types/bug70557.phpt
+++ b/Zend/tests/return_types/bug70557.phpt
@@ -10,8 +10,8 @@ function getNumber() : int {
try {
getNumber();
} catch (TypeError $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(62) "getNumber(): Return value must be of type int, string returned"
+TypeError: getNumber(): Return value must be of type int, string returned
diff --git a/Zend/tests/return_types/never_disallowed5.phpt b/Zend/tests/return_types/never_disallowed5.phpt
index 26887cd46833..a8df4ae61960 100644
--- a/Zend/tests/return_types/never_disallowed5.phpt
+++ b/Zend/tests/return_types/never_disallowed5.phpt
@@ -14,8 +14,8 @@ class Foo {
try {
Foo::bar();
} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Foo::bar(): never-returning method must not implicitly return
+TypeError: Foo::bar(): never-returning method must not implicitly return
diff --git a/Zend/tests/self_and.phpt b/Zend/tests/self_and.phpt
index f3662c575c48..2aa9f5b816e7 100644
--- a/Zend/tests/self_and.phpt
+++ b/Zend/tests/self_and.phpt
@@ -16,7 +16,7 @@ try {
$s1 &= 11;
var_dump($s1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$s2 &= 33;
@@ -32,7 +32,7 @@ echo "Done\n";
?>
--EXPECTF--
int(18)
-Unsupported operand types: string & int
+TypeError: Unsupported operand types: string & int
Warning: A non-numeric value encountered in %s on line %d
int(33)
diff --git a/Zend/tests/self_instanceof_outside_class.phpt b/Zend/tests/self_instanceof_outside_class.phpt
index ecb593a6a580..564267883207 100644
--- a/Zend/tests/self_instanceof_outside_class.phpt
+++ b/Zend/tests/self_instanceof_outside_class.phpt
@@ -7,11 +7,11 @@ $fn = function() {
try {
new stdClass instanceof self;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
};
$fn();
?>
--EXPECT--
-Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
diff --git a/Zend/tests/self_method_or_prop_outside_class.phpt b/Zend/tests/self_method_or_prop_outside_class.phpt
index feaeccf25f95..d77398f35341 100644
--- a/Zend/tests/self_method_or_prop_outside_class.phpt
+++ b/Zend/tests/self_method_or_prop_outside_class.phpt
@@ -8,29 +8,29 @@ $fn = function() {
try {
self::${$str . "bar"};
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset(self::${$str . "bar"});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
isset(self::${$str . "bar"});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::{$str . "bar"}();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
};
$fn();
?>
--EXPECT--
-Cannot access "self" when no class scope is active
-Cannot access "self" when no class scope is active
-Cannot access "self" when no class scope is active
-Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
+Error: Cannot access "self" when no class scope is active
diff --git a/Zend/tests/self_mod.phpt b/Zend/tests/self_mod.phpt
index 7d469f800239..e5c924d67c35 100644
--- a/Zend/tests/self_mod.phpt
+++ b/Zend/tests/self_mod.phpt
@@ -14,7 +14,7 @@ try {
$s1 %= 11;
var_dump($s1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$s2 %= 33;
@@ -24,7 +24,7 @@ echo "Done\n";
?>
--EXPECTF--
int(13)
-Unsupported operand types: string % int
+TypeError: Unsupported operand types: string % int
Warning: A non-numeric value encountered in %s on line %d
int(3)
diff --git a/Zend/tests/self_or.phpt b/Zend/tests/self_or.phpt
index 61f1f4203b08..7559065c8862 100644
--- a/Zend/tests/self_or.phpt
+++ b/Zend/tests/self_or.phpt
@@ -16,7 +16,7 @@ try {
$s1 |= 11;
var_dump($s1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$s2 |= 33;
@@ -32,7 +32,7 @@ echo "Done\n";
?>
--EXPECTF--
int(127)
-Unsupported operand types: string | int
+TypeError: Unsupported operand types: string | int
Warning: A non-numeric value encountered in %s on line %d
int(45345)
diff --git a/Zend/tests/self_xor.phpt b/Zend/tests/self_xor.phpt
index 4bff3f6d508e..7bf62b963734 100644
--- a/Zend/tests/self_xor.phpt
+++ b/Zend/tests/self_xor.phpt
@@ -16,7 +16,7 @@ try {
$s1 ^= 11;
var_dump($s1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$s2 ^= 33;
@@ -32,7 +32,7 @@ echo "Done\n";
?>
--EXPECTF--
int(109)
-Unsupported operand types: string ^ int
+TypeError: Unsupported operand types: string ^ int
Warning: A non-numeric value encountered in %s on line %d
int(45312)
diff --git a/Zend/tests/serialize/bug64354.phpt b/Zend/tests/serialize/bug64354.phpt
index 11b0aa31e247..a7c40a1631e6 100644
--- a/Zend/tests/serialize/bug64354.phpt
+++ b/Zend/tests/serialize/bug64354.phpt
@@ -17,9 +17,9 @@ $data = array(new B);
try {
serialize($data);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: B implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
-string(9) "serialize"
+Exception: serialize
diff --git a/Zend/tests/serialize/bug71841.phpt b/Zend/tests/serialize/bug71841.phpt
index f32b0e9b231f..c99e1ecc5091 100644
--- a/Zend/tests/serialize/bug71841.phpt
+++ b/Zend/tests/serialize/bug71841.phpt
@@ -6,40 +6,40 @@ $z = unserialize('O:1:"A":0:{}');
try {
var_dump($z->e.=0);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(++$z->x);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($z->y++);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$y = array(PHP_INT_MAX => 0);
try {
var_dump($y[] .= 0);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(++$y[]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($y[]++);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
-The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
-Cannot add element to the array as the next element is already occupied
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
diff --git a/Zend/tests/shift_001.phpt b/Zend/tests/shift_001.phpt
index f441cf2dcf8b..96a5e16986ee 100644
--- a/Zend/tests/shift_001.phpt
+++ b/Zend/tests/shift_001.phpt
@@ -14,7 +14,7 @@ try {
$s1 <<= 1;
var_dump($s1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$s2 <<= 3;
@@ -24,7 +24,7 @@ echo "Done\n";
?>
--EXPECTF--
int(492)
-Unsupported operand types: string << int
+TypeError: Unsupported operand types: string << int
Warning: A non-numeric value encountered in %s on line %d
int(362760)
diff --git a/Zend/tests/shift_002.phpt b/Zend/tests/shift_002.phpt
index 0bdc9b3eeb3c..a6087155ff7a 100644
--- a/Zend/tests/shift_002.phpt
+++ b/Zend/tests/shift_002.phpt
@@ -14,7 +14,7 @@ try {
$s1 >>= 1;
var_dump($s1);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$s2 >>= 3;
@@ -24,7 +24,7 @@ echo "Done\n";
?>
--EXPECTF--
int(30)
-Unsupported operand types: string >> int
+TypeError: Unsupported operand types: string >> int
Warning: A non-numeric value encountered in %s on line %d
int(5668)
diff --git a/Zend/tests/stack_limit/stack_limit_001.phpt b/Zend/tests/stack_limit/stack_limit_001.phpt
index 73cc3c08fe9d..56f84e751a64 100644
--- a/Zend/tests/stack_limit/stack_limit_001.phpt
+++ b/Zend/tests/stack_limit/stack_limit_001.phpt
@@ -36,19 +36,19 @@ function replace() {
try {
new Test1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -63,6 +63,6 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_002.phpt b/Zend/tests/stack_limit/stack_limit_002.phpt
index 64a11e1b2638..05d4c2dc03ed 100644
--- a/Zend/tests/stack_limit/stack_limit_002.phpt
+++ b/Zend/tests/stack_limit/stack_limit_002.phpt
@@ -35,19 +35,19 @@ $fiber = new Fiber(function (): void {
try {
new Test1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
});
@@ -65,6 +65,6 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_003.phpt b/Zend/tests/stack_limit/stack_limit_003.phpt
index 9956c761cb18..97f9756970bf 100644
--- a/Zend/tests/stack_limit/stack_limit_003.phpt
+++ b/Zend/tests/stack_limit/stack_limit_003.phpt
@@ -34,19 +34,19 @@ function replace() {
try {
new Test1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -61,6 +61,6 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_006.phpt b/Zend/tests/stack_limit/stack_limit_006.phpt
index d8d6251cf0c6..e97a1c2e0c5d 100644
--- a/Zend/tests/stack_limit/stack_limit_006.phpt
+++ b/Zend/tests/stack_limit/stack_limit_006.phpt
@@ -293,19 +293,19 @@ function replace() {
try {
new Test1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -320,6 +320,6 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_007.phpt b/Zend/tests/stack_limit/stack_limit_007.phpt
index d34e244234c2..2c77eca61b2e 100644
--- a/Zend/tests/stack_limit/stack_limit_007.phpt
+++ b/Zend/tests/stack_limit/stack_limit_007.phpt
@@ -19,7 +19,7 @@ function replace() {
$tryExecuted = true;
return replace();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
// We should not enter the catch block if we haven't executed at
// least one op in the try block
printf("Try executed: %d\n", $tryExecuted ?? 0);
@@ -41,5 +41,5 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
Try executed: 1
diff --git a/Zend/tests/stack_limit/stack_limit_008.phpt b/Zend/tests/stack_limit/stack_limit_008.phpt
index db61fb15e52c..b160b2010e81 100644
--- a/Zend/tests/stack_limit/stack_limit_008.phpt
+++ b/Zend/tests/stack_limit/stack_limit_008.phpt
@@ -22,7 +22,7 @@ function replace() {
try {
return replace2();
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}, 'x');
@@ -55,4 +55,4 @@ array(4) {
string(%d) "0x%x"
}
Will throw:
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_011.phpt b/Zend/tests/stack_limit/stack_limit_011.phpt
index 762f67184f6a..7d26a3269336 100644
--- a/Zend/tests/stack_limit/stack_limit_011.phpt
+++ b/Zend/tests/stack_limit/stack_limit_011.phpt
@@ -35,7 +35,7 @@ function replace() {
try {
replace();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
echo 'Previous: ', $e->getPrevious()->getMessage(), "\n";
}
@@ -51,5 +51,5 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
-Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
+Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
Previous: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
diff --git a/Zend/tests/stack_limit/stack_limit_014.phpt b/Zend/tests/stack_limit/stack_limit_014.phpt
index 144c64ad39ea..84e80d62a2fd 100644
--- a/Zend/tests/stack_limit/stack_limit_014.phpt
+++ b/Zend/tests/stack_limit/stack_limit_014.phpt
@@ -16,7 +16,7 @@ memory_limit=1G
try {
require __DIR__.'/stack_limit_014.inc';
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/static_method_non_existing_class.phpt b/Zend/tests/static_method_non_existing_class.phpt
index 752655d22782..424549394039 100644
--- a/Zend/tests/static_method_non_existing_class.phpt
+++ b/Zend/tests/static_method_non_existing_class.phpt
@@ -7,9 +7,9 @@ $str = "foo";
try {
Test::{$str . "bar"}();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Class "Test" not found
+Error: Class "Test" not found
diff --git a/Zend/tests/static_variables/static_variables_destructor.phpt b/Zend/tests/static_variables/static_variables_destructor.phpt
index 9128c86e6b1b..3d848f0bd5fb 100644
--- a/Zend/tests/static_variables/static_variables_destructor.phpt
+++ b/Zend/tests/static_variables/static_variables_destructor.phpt
@@ -25,12 +25,12 @@ function foo(bool $throw) {
try {
foo(true);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
foo(false);
?>
--EXPECT--
bar() called
-__destruct() called
+Exception: __destruct() called
int(42)
diff --git a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
index 9e4752c24f5c..192df8c9a3e6 100644
--- a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
+++ b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
@@ -11,11 +11,11 @@ function foo($throw) {
try {
var_dump(foo(true));
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(foo(false));
?>
--EXPECT--
-Throwing from foo()
+Exception: Throwing from foo()
int(42)
diff --git a/Zend/tests/str_or_obj_of_class_zpp.phpt b/Zend/tests/str_or_obj_of_class_zpp.phpt
index dec9bee69d5c..bac57acdc3da 100644
--- a/Zend/tests/str_or_obj_of_class_zpp.phpt
+++ b/Zend/tests/str_or_obj_of_class_zpp.phpt
@@ -21,13 +21,13 @@ var_dump(zend_string_or_stdclass(new ToString()));
try {
zend_string_or_stdclass([]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
zend_string_or_stdclass(new Foo());
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(zend_string_or_stdclass_or_null("string"));
@@ -39,13 +39,13 @@ var_dump(zend_string_or_stdclass_or_null(new ToString()));
try {
zend_string_or_stdclass_or_null([]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
zend_string_or_stdclass_or_null(new Foo());
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
@@ -58,13 +58,13 @@ string(0) ""
object(stdClass)#1 (0) {
}
string(8) "ToString"
-zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, array given
-zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, Foo given
+TypeError: zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, array given
+TypeError: zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, Foo given
string(6) "string"
string(1) "1"
NULL
object(stdClass)#1 (0) {
}
string(8) "ToString"
-zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, array given
-zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, Foo given
+TypeError: zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, array given
+TypeError: zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, Foo given
diff --git a/Zend/tests/str_or_obj_zpp.phpt b/Zend/tests/str_or_obj_zpp.phpt
index 3c71bde5fd3a..18a69a53a7a9 100644
--- a/Zend/tests/str_or_obj_zpp.phpt
+++ b/Zend/tests/str_or_obj_zpp.phpt
@@ -16,7 +16,7 @@ var_dump(zend_string_or_object(new Foo()));
try {
zend_string_or_object([]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(zend_string_or_object_or_null("string"));
@@ -28,7 +28,7 @@ var_dump(zend_string_or_object_or_null(new Foo()));
try {
zend_string_or_object_or_null([]);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
@@ -42,7 +42,7 @@ object(stdClass)#1 (0) {
}
object(Foo)#1 (0) {
}
-zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given
+TypeError: zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given
string(6) "string"
string(1) "1"
NULL
@@ -50,4 +50,4 @@ object(stdClass)#2 (0) {
}
object(Foo)#2 (0) {
}
-zend_string_or_object_or_null(): Argument #1 ($param) must be of type object|string|null, array given
+TypeError: zend_string_or_object_or_null(): Argument #1 ($param) must be of type object|string|null, array given
diff --git a/Zend/tests/string_offset_as_object.phpt b/Zend/tests/string_offset_as_object.phpt
index 6fdebe936088..8631bd82fd5b 100644
--- a/Zend/tests/string_offset_as_object.phpt
+++ b/Zend/tests/string_offset_as_object.phpt
@@ -7,57 +7,57 @@ $str = "x";
try {
$str[0]->bar = "xyz";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar[1] = "bang";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar += 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar = &$b;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
++$str[0]->bar;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
--$str[0]->bar;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar++;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar--;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($str[0]->bar);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
-Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
+Error: Cannot use string offset as an object
diff --git a/Zend/tests/string_offset_errors.phpt b/Zend/tests/string_offset_errors.phpt
index 726dc41f0653..cd1cc1fb4825 100644
--- a/Zend/tests/string_offset_errors.phpt
+++ b/Zend/tests/string_offset_errors.phpt
@@ -16,24 +16,24 @@ function &gen() {
try {
test();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str = "foo";
$str[0] =& $str[1];
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foreach (gen() as $v) {}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot create references to/from string offsets
-Cannot create references to/from string offsets
-Cannot create references to/from string offsets
+Error: Cannot create references to/from string offsets
+Error: Cannot create references to/from string offsets
+Error: Cannot create references to/from string offsets
diff --git a/Zend/tests/strlen_deprecation_to_exception.phpt b/Zend/tests/strlen_deprecation_to_exception.phpt
index 7b616f3b6432..7a6dcf3699d3 100644
--- a/Zend/tests/strlen_deprecation_to_exception.phpt
+++ b/Zend/tests/strlen_deprecation_to_exception.phpt
@@ -9,9 +9,9 @@ set_error_handler(function($_, $msg) {
try {
strlen(null);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-strlen(): Passing null to parameter #1 ($string) of type string is deprecated
+Exception: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
diff --git a/Zend/tests/strncasecmp_basic.phpt b/Zend/tests/strncasecmp_basic.phpt
index 54eb6fb5209b..9b41495752e6 100644
--- a/Zend/tests/strncasecmp_basic.phpt
+++ b/Zend/tests/strncasecmp_basic.phpt
@@ -6,7 +6,7 @@ strncasecmp() tests
try {
var_dump(strncasecmp("", "", -1));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(strncasecmp("aef", "dfsgbdf", 0));
@@ -19,7 +19,7 @@ var_dump(strncasecmp("01", "01", 1000));
?>
--EXPECT--
-strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0
int(0)
int(-3)
int(0)
diff --git a/Zend/tests/strncmp_basic.phpt b/Zend/tests/strncmp_basic.phpt
index bb40946f240a..a9d0ea6d257a 100644
--- a/Zend/tests/strncmp_basic.phpt
+++ b/Zend/tests/strncmp_basic.phpt
@@ -7,7 +7,7 @@ var_dump(strncmp("", "", 100));
try {
var_dump(strncmp("aef", "dfsgbdf", -1));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(strncmp("fghjkl", "qwer", 0));
var_dump(strncmp("qwerty", "qwerty123", 6));
@@ -16,7 +16,7 @@ var_dump(strncmp("qwerty", "qwerty123", 7));
?>
--EXPECT--
int(0)
-strncmp(): Argument #3 ($length) must be greater than or equal to 0
+ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0
int(0)
int(0)
int(-1)
diff --git a/Zend/tests/sub_001.phpt b/Zend/tests/sub_001.phpt
index 92e3ff0021f0..66e268d65b62 100644
--- a/Zend/tests/sub_001.phpt
+++ b/Zend/tests/sub_001.phpt
@@ -9,7 +9,7 @@ $b = array(1);
try {
var_dump($a - $b);
} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $a - $b;
@@ -18,7 +18,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Exception: Unsupported operand types: array - array
+TypeError: Unsupported operand types: array - array
Fatal error: Uncaught TypeError: Unsupported operand types: array - array in %s:%d
Stack trace:
diff --git a/Zend/tests/switch/bug80046.phpt b/Zend/tests/switch/bug80046.phpt
index 87a493c20308..45adb6e9726f 100644
--- a/Zend/tests/switch/bug80046.phpt
+++ b/Zend/tests/switch/bug80046.phpt
@@ -14,9 +14,9 @@ function test($foo) {
try {
test('Foo');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Default
+Exception: Default
diff --git a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
index 95d2fc1233d4..d93dd64077da 100644
--- a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
+++ b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
@@ -12,9 +12,9 @@ class Foo {
try {
Foo::test();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Access to undeclared static property Foo::$property
+Error: Access to undeclared static property Foo::$property
diff --git a/Zend/tests/this-reserved/this_in_extract.phpt b/Zend/tests/this-reserved/this_in_extract.phpt
index 2e3f7b497fdb..3157f35ac4e1 100644
--- a/Zend/tests/this-reserved/this_in_extract.phpt
+++ b/Zend/tests/this-reserved/this_in_extract.phpt
@@ -6,14 +6,14 @@ function foo() {
try {
extract(["this"=>42, "a"=>24]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($a);
}
foo();
?>
--EXPECTF--
-Cannot re-assign $this
+Error: Cannot re-assign $this
Warning: Undefined variable $a in %s on line %d
NULL
diff --git a/Zend/tests/throw/001.phpt b/Zend/tests/throw/001.phpt
index ba2406c6d388..91d30d717440 100644
--- a/Zend/tests/throw/001.phpt
+++ b/Zend/tests/throw/001.phpt
@@ -7,84 +7,84 @@ try {
$result = true && throw new Exception("true && throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false && throw new Exception("false && throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = true and throw new Exception("true and throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false and throw new Exception("false and throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = true || throw new Exception("true || throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false || throw new Exception("false || throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = true or throw new Exception("true or throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false or throw new Exception("false or throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = null ?? throw new Exception("null ?? throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = "foo" ?? throw new Exception('"foo" ?? throw');
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = null ?: throw new Exception("null ?: throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = "foo" ?: throw new Exception('"foo" ?: throw');
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -92,7 +92,7 @@ try {
var_dump("not yet");
$callable();
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$result = "bar";
@@ -107,27 +107,27 @@ try {
throw new Exception("exception 2")
);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = true ? true : throw new Exception("true ? true : throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false ? true : throw new Exception("false ? true : throw");
var_dump($result);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
throw new Exception() + 1;
} catch (Throwable $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -144,30 +144,30 @@ var_dump($exception->getMessage());
try {
throw null ?? new Exception('throw null ?? new Exception();');
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(13) "true && throw"
+Exception: true && throw
bool(false)
-string(14) "true and throw"
+Exception: true and throw
bool(false)
bool(true)
-string(14) "false || throw"
+Exception: false || throw
bool(true)
-string(14) "false or throw"
-string(13) "null ?? throw"
+Exception: false or throw
+Exception: null ?? throw
string(3) "foo"
-string(13) "null ?: throw"
+Exception: null ?: throw
string(3) "foo"
string(7) "not yet"
-string(13) "fn() => throw"
+Exception: fn() => throw
string(3) "bar"
-string(11) "exception 1"
+Exception: exception 1
bool(true)
-string(20) "false ? true : throw"
-string(42) "Unsupported operand types: Exception + int"
+Exception: false ? true : throw
+TypeError: Unsupported operand types: Exception + int
string(35) "throw $exception = new Exception();"
string(37) "throw $exception ??= new Exception();"
-string(30) "throw null ?? new Exception();"
+Exception: throw null ?? new Exception();
diff --git a/Zend/tests/throw/002.phpt b/Zend/tests/throw/002.phpt
index e80dfbb7d14d..a904c09f6080 100644
--- a/Zend/tests/throw/002.phpt
+++ b/Zend/tests/throw/002.phpt
@@ -24,25 +24,25 @@ class Foo {
try {
(new Foo())->throwException();
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Foo::staticThrowException();
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
throw true ? new Exception('Ternary true 1') : new Exception('Ternary true 2');
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
throw false ? new Exception('Ternary false 1') : new Exception('Ternary false 2');
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -50,7 +50,7 @@ try {
$exception2 = new Exception('Coalesce non-null 2');
throw $exception1 ?? $exception2;
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -58,27 +58,27 @@ try {
$exception2 = new Exception('Coalesce null 2');
throw $exception1 ?? $exception2;
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
throw $exception = new Exception('Assignment');
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$exception = null;
throw $exception ??= new Exception('Coalesce assignment null');
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$exception = new Exception('Coalesce assignment non-null 1');
throw $exception ??= new Exception('Coalesce assignment non-null 2');
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$andConditionalTest = function ($condition1, $condition2) {
@@ -90,39 +90,39 @@ $andConditionalTest = function ($condition1, $condition2) {
try {
$andConditionalTest(false, false);
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$andConditionalTest(false, true);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$andConditionalTest(true, false);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$andConditionalTest(true, true);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Not found
-Static not found
-Ternary true 1
-Ternary false 2
-Coalesce non-null 1
-Coalesce null 2
-Assignment
-Coalesce assignment null
-Coalesce assignment non-null 1
-And in conditional 2
-And in conditional 2
-And in conditional 2
-And in conditional 1
+Exception: Not found
+Exception: Static not found
+Exception: Ternary true 1
+Exception: Ternary false 2
+Exception: Coalesce non-null 1
+Exception: Coalesce null 2
+Exception: Assignment
+Exception: Coalesce assignment null
+Exception: Coalesce assignment non-null 1
+Exception: And in conditional 2
+Exception: And in conditional 2
+Exception: And in conditional 2
+Exception: And in conditional 1
diff --git a/Zend/tests/throwing_overloaded_compound_assign_op.phpt b/Zend/tests/throwing_overloaded_compound_assign_op.phpt
index 39c38627076c..2f50984734b3 100644
--- a/Zend/tests/throwing_overloaded_compound_assign_op.phpt
+++ b/Zend/tests/throwing_overloaded_compound_assign_op.phpt
@@ -16,7 +16,7 @@ $test[0] = 42;
try {
$test[0] %= 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
@@ -24,13 +24,13 @@ $test2 = new Test;
try {
$test2->prop %= 0;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test2);
?>
--EXPECT--
-Modulo by zero
+DivisionByZeroError: Modulo by zero
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(1) {
@@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) {
int(42)
}
}
-Modulo by zero
+DivisionByZeroError: Modulo by zero
object(Test)#3 (1) {
["prop"]=>
int(42)
diff --git a/Zend/tests/traits/gh_17728.phpt b/Zend/tests/traits/gh_17728.phpt
index ef458a8e8d5e..69a3128fece1 100644
--- a/Zend/tests/traits/gh_17728.phpt
+++ b/Zend/tests/traits/gh_17728.phpt
@@ -16,9 +16,9 @@ trait Foo {
try {
Foo::bar();
} catch (ErrorException $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait
+ErrorException: Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait
diff --git a/Zend/tests/traits/trait_type_errors.phpt b/Zend/tests/traits/trait_type_errors.phpt
index d3c7c0582fb1..f9cf86305579 100644
--- a/Zend/tests/traits/trait_type_errors.phpt
+++ b/Zend/tests/traits/trait_type_errors.phpt
@@ -23,21 +23,21 @@ $c = new C;
try {
$c->test1("foo");
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->test2("foo");
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->test3("foo");
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-C::test1(): Return value must be of type int, string returned
-C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
-C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
+TypeError: C::test1(): Return value must be of type int, string returned
+TypeError: C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
+TypeError: C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d
diff --git a/Zend/tests/trigger_error_basic.phpt b/Zend/tests/trigger_error_basic.phpt
index d492590bcd92..f0beff31622c 100644
--- a/Zend/tests/trigger_error_basic.phpt
+++ b/Zend/tests/trigger_error_basic.phpt
@@ -8,12 +8,12 @@ var_dump(trigger_error("error"));
try {
var_dump(trigger_error("error", -1));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(trigger_error("error", 0));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(trigger_error("error", E_USER_WARNING));
@@ -23,8 +23,8 @@ var_dump(trigger_error("error", E_USER_DEPRECATED));
--EXPECTF--
Notice: error in %s on line %d
bool(true)
-trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
-trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
+ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
+ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
Warning: error in %s on line %d
bool(true)
diff --git a/Zend/tests/try/bug70228_3.phpt b/Zend/tests/try/bug70228_3.phpt
index 55dbe4f8914a..0f02d2a6def7 100644
--- a/Zend/tests/try/bug70228_3.phpt
+++ b/Zend/tests/try/bug70228_3.phpt
@@ -21,11 +21,11 @@ try {
var_dump(test());
} catch (Exception $e) {
do {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
$e = $e->getPrevious();
} while ($e);
}
?>
--EXPECT--
-2
-1
+Exception: 2
+Exception: 1
diff --git a/Zend/tests/try/bug70228_4.phpt b/Zend/tests/try/bug70228_4.phpt
index f0ab3b0c2c11..8d2e3e0717bd 100644
--- a/Zend/tests/try/bug70228_4.phpt
+++ b/Zend/tests/try/bug70228_4.phpt
@@ -23,10 +23,10 @@ try {
var_dump(test());
} catch (Exception $e) {
do {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
$e = $e->getPrevious();
} while ($e);
}
?>
--EXPECT--
-1
+Exception: 1
diff --git a/Zend/tests/try/bug70228_5.phpt b/Zend/tests/try/bug70228_5.phpt
index 29cbf4910de1..e1bbf959d465 100644
--- a/Zend/tests/try/bug70228_5.phpt
+++ b/Zend/tests/try/bug70228_5.phpt
@@ -13,8 +13,8 @@ function test() {
try {
test();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ops
+Exception: ops
diff --git a/Zend/tests/try/bug72213.phpt b/Zend/tests/try/bug72213.phpt
index 50555f53e419..493e9db15d59 100644
--- a/Zend/tests/try/bug72213.phpt
+++ b/Zend/tests/try/bug72213.phpt
@@ -16,10 +16,10 @@ function test() {
try {
test();
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($e->getPrevious()->getMessage());
}
?>
--EXPECT--
-string(1) "b"
+Exception: b
string(1) "a"
diff --git a/Zend/tests/try/bug72213_2.phpt b/Zend/tests/try/bug72213_2.phpt
index a9b5f1490b2d..eca2e5e8e135 100644
--- a/Zend/tests/try/bug72213_2.phpt
+++ b/Zend/tests/try/bug72213_2.phpt
@@ -19,8 +19,8 @@ function test() {
try {
test();
} catch (Exception $e) {
- echo "caught {$e->getMessage()}\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-caught 1
+Exception: 1
diff --git a/Zend/tests/try/catch_finally_006.phpt b/Zend/tests/try/catch_finally_006.phpt
index 216219b6a5b3..6f4027721bf8 100644
--- a/Zend/tests/try/catch_finally_006.phpt
+++ b/Zend/tests/try/catch_finally_006.phpt
@@ -19,7 +19,7 @@ try {
var_dump(foo("para"));
} catch (Exception $e) {
"caught exception" . PHP_EOL;
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/Zend/tests/try/try_finally_002.phpt b/Zend/tests/try/try_finally_002.phpt
index 99a34f62fbd7..3c595f7a11ac 100644
--- a/Zend/tests/try/try_finally_002.phpt
+++ b/Zend/tests/try/try_finally_002.phpt
@@ -14,10 +14,10 @@ try {
foo();
} catch (Exception $e) {
do {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
} while ($e = $e->getPrevious());
}
?>
--EXPECT--
-string(7) "finally"
-string(3) "try"
+Exception: finally
+Exception: try
diff --git a/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt b/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
index 3f720ba2b47f..d63fff22ed68 100644
--- a/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
+++ b/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt
@@ -12,9 +12,9 @@ set_error_handler(function($_, $msg) {
try {
test(0.5);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Implicit conversion from float 0.5 to int loses precision
+Exception: Implicit conversion from float 0.5 to int loses precision
diff --git a/Zend/tests/type_coercion/gh22112.phpt b/Zend/tests/type_coercion/gh22112.phpt
index 84fdc393a828..d7629960da5e 100644
--- a/Zend/tests/type_coercion/gh22112.phpt
+++ b/Zend/tests/type_coercion/gh22112.phpt
@@ -20,16 +20,16 @@ $nan = fdiv(0, 0);
try {
take_bool($nan);
} catch (Exception $e) {
- echo "bool: ", $e->getMessage(), "\n";
+ echo 'bool: ', $e::class, ': ', $e->getMessage(), "\n";
}
try {
take_string($nan);
} catch (Exception $e) {
- echo "string: ", $e->getMessage(), "\n";
+ echo 'string: ', $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-bool: unexpected NAN value was coerced to bool
-string: unexpected NAN value was coerced to string
+bool: Exception: unexpected NAN value was coerced to bool
+string: Exception: unexpected NAN value was coerced to string
diff --git a/Zend/tests/type_coercion/settype/settype_resource.phpt b/Zend/tests/type_coercion/settype/settype_resource.phpt
index fa9ca739fa90..aeadc3d4c0f5 100644
--- a/Zend/tests/type_coercion/settype/settype_resource.phpt
+++ b/Zend/tests/type_coercion/settype/settype_resource.phpt
@@ -33,7 +33,7 @@ foreach ($vars as $var) {
try {
settype($var, "resource");
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump($var);
}
@@ -41,22 +41,22 @@ foreach ($vars as $var) {
echo "Done\n";
?>
--EXPECTF--
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
string(6) "string"
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
string(7) "8754456"
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
string(0) ""
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
string(1) "%0"
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
int(9876545)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
float(0.1)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
array(0) {
}
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
array(3) {
[0]=>
int(1)
@@ -65,15 +65,15 @@ array(3) {
[2]=>
int(3)
}
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
bool(false)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
bool(true)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
NULL
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
resource(%d) of type (stream)
-Cannot convert to resource type
+ValueError: Cannot convert to resource type
object(test)#%d (0) {
}
Done
diff --git a/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt b/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
index 17921e5ae530..73fea49fb208 100644
--- a/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
+++ b/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt
@@ -18,4 +18,4 @@ var_dump($nan);
--EXPECT--
float(NAN)
unexpected NAN value was coerced to string
-string(3) "NAN"
\ No newline at end of file
+string(3) "NAN"
diff --git a/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt b/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
index 26911bddb7eb..24243badbcbf 100644
--- a/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
+++ b/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt
@@ -8,11 +8,11 @@ try {
(void) somefunc();
});
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && function () {
+AssertionError: assert(false && function () {
(void)somefunc();
})
diff --git a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
index 6375c60ab71b..c23541d9446b 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
@@ -41,12 +41,12 @@ var_dump($o);
try {
bar1();
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bar2();
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -59,5 +59,5 @@ object(B)#%d (0) {
}
object(B)#%d (0) {
}
-bar1(): Return value must be of type (X&Y)|(W&Z), C returned
-bar2(): Return value must be of type (W&Z)|(X&Y), C returned
+TypeError: bar1(): Return value must be of type (X&Y)|(W&Z), C returned
+TypeError: bar2(): Return value must be of type (W&Z)|(X&Y), C returned
diff --git a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
index e9089c130b49..cca12fb11e54 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt
@@ -40,22 +40,22 @@ $c = new C();
try {
$test->foo1($c);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->foo2($c);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->prop1 = $c;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->prop2 = $c;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -67,8 +67,8 @@ object(A)#2 (0) {
}
NULL
NULL
-Test::foo1(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
-Test::foo2(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
-Cannot assign C to property Test::$prop1 of type (X&Y)|null
-Cannot assign C to property Test::$prop2 of type (X&Y)|null
+TypeError: Test::foo1(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
+TypeError: Test::foo2(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d
+TypeError: Cannot assign C to property Test::$prop1 of type (X&Y)|null
+TypeError: Cannot assign C to property Test::$prop2 of type (X&Y)|null
===DONE===
diff --git a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
index 4c9a5f95e30d..92f8ef2b3b89 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt
@@ -61,42 +61,42 @@ $c = new C();
try {
$test->foo1($c);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->foo2($c);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->bar1($c);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->bar2($c);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->prop1 = $c;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->prop2 = $c;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->prop3 = $c;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$test->prop4 = $c;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -116,12 +116,12 @@ object(B)#3 (0) {
}
object(B)#3 (0) {
}
-Test::foo1(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
-Test::foo2(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
-Test::bar1(): Argument #1 ($v) must be of type B|(X&Y), C given, called in %s on line %d
-Test::bar2(): Argument #1 ($v) must be of type (X&Y)|B, C given, called in %s on line %d
-Cannot assign C to property Test::$prop1 of type (X&Y)|int
-Cannot assign C to property Test::$prop2 of type (X&Y)|int
-Cannot assign C to property Test::$prop3 of type (X&Y)|B
-Cannot assign C to property Test::$prop4 of type B|(X&Y)
+TypeError: Test::foo1(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
+TypeError: Test::foo2(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d
+TypeError: Test::bar1(): Argument #1 ($v) must be of type B|(X&Y), C given, called in %s on line %d
+TypeError: Test::bar2(): Argument #1 ($v) must be of type (X&Y)|B, C given, called in %s on line %d
+TypeError: Cannot assign C to property Test::$prop1 of type (X&Y)|int
+TypeError: Cannot assign C to property Test::$prop2 of type (X&Y)|int
+TypeError: Cannot assign C to property Test::$prop3 of type (X&Y)|B
+TypeError: Cannot assign C to property Test::$prop4 of type B|(X&Y)
===DONE===
diff --git a/Zend/tests/type_declarations/dnf_types/gh9516.phpt b/Zend/tests/type_declarations/dnf_types/gh9516.phpt
index 3d91932ebd45..7fed8eb8a71c 100644
--- a/Zend/tests/type_declarations/dnf_types/gh9516.phpt
+++ b/Zend/tests/type_declarations/dnf_types/gh9516.phpt
@@ -25,28 +25,28 @@ try {
$t->method1(new A_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method1(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method1(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method1(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
// Lets try in reverse?
@@ -54,28 +54,28 @@ try {
$t->method2(new A_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method2(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method2(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method2(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
/* Single before intersection */
@@ -83,28 +83,28 @@ try {
$t->method3(new A_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method3(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method3(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method3(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
// Lets try in reverse?
@@ -112,46 +112,46 @@ try {
$t->method4(new A_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method4(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method4(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
try {
$t->method4(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-T::method1(): Argument #1 ($arg) must be of type (A&B)|D, A_ given, called in %s on line %d
-T::method1(): Argument #1 ($arg) must be of type (A&B)|D, B_ given, called in %s on line %d
+TypeError: T::method1(): Argument #1 ($arg) must be of type (A&B)|D, A_ given, called in %s on line %d
+TypeError: T::method1(): Argument #1 ($arg) must be of type (A&B)|D, B_ given, called in %s on line %d
Pass
Pass
-T::method2(): Argument #1 ($arg) must be of type (B&A)|D, A_ given, called in %s on line %d
-T::method2(): Argument #1 ($arg) must be of type (B&A)|D, B_ given, called in %s on line %d
+TypeError: T::method2(): Argument #1 ($arg) must be of type (B&A)|D, A_ given, called in %s on line %d
+TypeError: T::method2(): Argument #1 ($arg) must be of type (B&A)|D, B_ given, called in %s on line %d
Pass
Pass
-T::method3(): Argument #1 ($arg) must be of type D|(A&B), A_ given, called in %s on line %d
-T::method3(): Argument #1 ($arg) must be of type D|(A&B), B_ given, called in %s on line %d
+TypeError: T::method3(): Argument #1 ($arg) must be of type D|(A&B), A_ given, called in %s on line %d
+TypeError: T::method3(): Argument #1 ($arg) must be of type D|(A&B), B_ given, called in %s on line %d
Pass
Pass
-T::method4(): Argument #1 ($arg) must be of type D|(B&A), A_ given, called in %s on line %d
-T::method4(): Argument #1 ($arg) must be of type D|(B&A), B_ given, called in %s on line %d
+TypeError: T::method4(): Argument #1 ($arg) must be of type D|(B&A), A_ given, called in %s on line %d
+TypeError: T::method4(): Argument #1 ($arg) must be of type D|(B&A), B_ given, called in %s on line %d
Pass
Pass
diff --git a/Zend/tests/type_declarations/internal_function_strict_mode.phpt b/Zend/tests/type_declarations/internal_function_strict_mode.phpt
index 5b2ad90abfea..90ce94953bfe 100644
--- a/Zend/tests/type_declarations/internal_function_strict_mode.phpt
+++ b/Zend/tests/type_declarations/internal_function_strict_mode.phpt
@@ -8,28 +8,28 @@ echo "*** Trying Ord With Integer" . PHP_EOL;
try {
var_dump(ord(1));
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "*** Trying Array Map With Invalid Callback" . PHP_EOL;
try {
array_map([null, "bar"], []);
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "*** Trying Strlen With Float" . PHP_EOL;
try {
var_dump(strlen(1.5));
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
*** Trying Ord With Integer
-*** Caught ord(): Argument #1 ($character) must be of type string, int given
+TypeError: ord(): Argument #1 ($character) must be of type string, int given
*** Trying Array Map With Invalid Callback
-*** Caught array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object
+TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object
*** Trying Strlen With Float
-*** Caught strlen(): Argument #1 ($string) must be of type string, float given
+TypeError: strlen(): Argument #1 ($string) must be of type string, float given
diff --git a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
index 568e6e25afad..8268731d743d 100644
--- a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
+++ b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
@@ -29,7 +29,7 @@ $o = new A();
try {
$o->prop = $tp;
} catch (TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$o->prop = $tc;
@@ -46,7 +46,7 @@ var_dump($r);
?>
--EXPECTF--
-Cannot assign TestParent to property A::$prop of type X&Y&Z
+TypeError: Cannot assign TestParent to property A::$prop of type X&Y&Z
object(TestChild)#%d (0) {
}
object(TestParent)#%d (0) {
diff --git a/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt b/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
index 83af5e96ccfa..bbeded80b56b 100644
--- a/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
+++ b/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt
@@ -10,10 +10,10 @@ function foo(X&Y $foo = null) {
try {
foo(5);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Deprecated: foo(): Implicitly marking parameter $foo as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
-foo(): Argument #1 ($foo) must be of type (X&Y)|null, int given, called in %s on line %d
+TypeError: foo(): Argument #1 ($foo) must be of type (X&Y)|null, int given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt b/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
index e724e1b15f50..15bbc4a69d19 100644
--- a/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
+++ b/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt
@@ -25,7 +25,7 @@ try {
$o = foo();
var_dump($o);
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = new Collection();
@@ -34,17 +34,17 @@ $a = new A();
try {
$c->intersect = $a;
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bar($a);
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-foo(): Return value must be of type X&Y, A returned
-Cannot assign A to property Collection::$intersect of type X&Y
-bar(): Argument #1 ($o) must be of type X&Y, A given, called in %s on line %d
+TypeError: foo(): Return value must be of type X&Y, A returned
+TypeError: Cannot assign A to property Collection::$intersect of type X&Y
+TypeError: bar(): Argument #1 ($o) must be of type X&Y, A given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/intersection_types/parameter.phpt b/Zend/tests/type_declarations/intersection_types/parameter.phpt
index d1c7de224365..1abf823d8410 100644
--- a/Zend/tests/type_declarations/intersection_types/parameter.phpt
+++ b/Zend/tests/type_declarations/intersection_types/parameter.phpt
@@ -18,11 +18,11 @@ foo(new Foo());
try {
foo(new Bar());
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
object(Foo)#1 (0) {
}
-foo(): Argument #1 ($bar) must be of type A&B, Bar given, called in %s on line %d
+TypeError: foo(): Argument #1 ($bar) must be of type A&B, Bar given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
index 2ceb34f256ff..36e1ddf58dd0 100644
--- a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
+++ b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
@@ -22,9 +22,9 @@ $test->z =& $r;
try {
$r = new B;
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot assign B to reference held by property Test::$z of type X&Z
+TypeError: Cannot assign B to reference held by property Test::$z of type X&Z
diff --git a/Zend/tests/type_declarations/iterable/iterable_001.phpt b/Zend/tests/type_declarations/iterable/iterable_001.phpt
index 7c127c8e1dfd..950afb253fd3 100644
--- a/Zend/tests/type_declarations/iterable/iterable_001.phpt
+++ b/Zend/tests/type_declarations/iterable/iterable_001.phpt
@@ -20,7 +20,7 @@ test(new ArrayIterator([1, 2, 3]));
try {
test(1);
} catch (Throwable $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
@@ -47,4 +47,4 @@ object(ArrayIterator)#1 (1) {
int(3)
}
}
-test(): Argument #1 ($iterable) must be of type Traversable|array, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($iterable) must be of type Traversable|array, int given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/iterable/iterable_003.phpt b/Zend/tests/type_declarations/iterable/iterable_003.phpt
index a2c96995da37..a88c820e9b29 100644
--- a/Zend/tests/type_declarations/iterable/iterable_003.phpt
+++ b/Zend/tests/type_declarations/iterable/iterable_003.phpt
@@ -20,7 +20,7 @@ var_dump(bar());
try {
baz();
} catch (Throwable $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -31,4 +31,4 @@ object(Generator)#%d (1) {
["function"]=>
string(17) "{closure:bar():7}"
}
-baz(): Return value must be of type Traversable|array, int returned
+TypeError: baz(): Return value must be of type Traversable|array, int returned
diff --git a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
index 61900f993c0e..34069507c9fd 100644
--- a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
+++ b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
@@ -8,21 +8,21 @@ function test(false $v) { var_dump($v); }
try {
test(0);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
test('');
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
test([]);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-test(): Argument #1 ($v) must be of type false, int given, called in %s on line %d
-test(): Argument #1 ($v) must be of type false, string given, called in %s on line %d
-test(): Argument #1 ($v) must be of type false, array given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type false, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type false, string given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type false, array given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt b/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
index 726245705ffc..d584c5aaee0a 100644
--- a/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
+++ b/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
@@ -22,10 +22,10 @@ var_dump($p->foo(0));
try {
var_dump($c->foo(0));
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
bool(false)
-C::foo(): Return value must be of type array|false, int returned
+TypeError: C::foo(): Return value must be of type array|false, int returned
diff --git a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
index 85d6c90cd057..ad52b605b72c 100644
--- a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
+++ b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
@@ -8,27 +8,27 @@ function test(true $v) { var_dump($v); }
try {
test(1);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
test('1');
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
test([1]);
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
test(new stdClass());
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-test(): Argument #1 ($v) must be of type true, int given, called in %s on line %d
-test(): Argument #1 ($v) must be of type true, string given, called in %s on line %d
-test(): Argument #1 ($v) must be of type true, array given, called in %s on line %d
-test(): Argument #1 ($v) must be of type true, stdClass given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, int given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, string given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, array given, called in %s on line %d
+TypeError: test(): Argument #1 ($v) must be of type true, stdClass given, called in %s on line %d
diff --git a/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt b/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
index 7eebe1e3571f..7090d72747e6 100644
--- a/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
+++ b/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt
@@ -22,10 +22,10 @@ var_dump($p->foo(1));
try {
var_dump($c->foo(1));
} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
bool(true)
-C::foo(): Return value must be of type array|true, int returned
+TypeError: C::foo(): Return value must be of type array|true, int returned
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
index 8a2c60002054..b77d9ca8e168 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt
@@ -28,9 +28,9 @@ $foo = new Foo();
try {
$foo->property1;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Typed property Foo::$property1 must not be accessed before initialization
+Error: Typed property Foo::$property1 must not be accessed before initialization
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
index e83023d54cf2..b633cfb4a8cc 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt
@@ -27,9 +27,9 @@ $foo = new Foo();
try {
$foo->property1;
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Typed property Foo::$property1 must not be accessed before initialization
+Error: Typed property Foo::$property1 must not be accessed before initialization
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
index 2bd775af0a47..52bbfc2d67e3 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
@@ -11,9 +11,9 @@ function foo(): mixed
try {
foo();
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-foo(): Return value must be of type mixed, none returned
+TypeError: foo(): Return value must be of type mixed, none returned
diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
index 52bd99beb6cd..f1eb0a131852 100644
--- a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
+++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
@@ -10,9 +10,9 @@ function foo(): mixed
try {
foo();
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-foo(): Return value must be of type mixed, none returned
+TypeError: foo(): Return value must be of type mixed, none returned
diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt
index 352c48f8a9e0..ab57111bfed3 100644
--- a/Zend/tests/type_declarations/scalar_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_basic.phpt
@@ -53,7 +53,7 @@ foreach ($functions as $type => $function) {
try {
var_dump($function($value));
} catch (\TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}
@@ -76,19 +76,19 @@ E_DEPRECATED: Implicit conversion from float 1.5 to int loses precision on line
int(1)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying int(%d)
int(%d)
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying bool(true)
int(1)
@@ -97,22 +97,22 @@ int(1)
int(0)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
Testing 'float' type:
@@ -129,13 +129,13 @@ float(1)
float(1.5)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying int(%d)
float(%s)
@@ -150,22 +150,22 @@ float(1)
float(0)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
Testing 'string' type:
@@ -204,22 +204,22 @@ string(1) "1"
string(0) ""
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%s (0) {
}
string(6) "foobar"
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
Testing 'bool' type:
@@ -258,21 +258,21 @@ bool(true)
bool(false)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%s (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_constant_defaults.phpt b/Zend/tests/type_declarations/scalar_constant_defaults.phpt
index 5e3826de7dcb..eed7ed58b228 100644
--- a/Zend/tests/type_declarations/scalar_constant_defaults.phpt
+++ b/Zend/tests/type_declarations/scalar_constant_defaults.phpt
@@ -65,14 +65,14 @@ echo "Testing int with default null constant" . PHP_EOL;
try {
var_dump(int_val_default_null());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Testing int with null null constant" . PHP_EOL;
try {
var_dump(int_val_default_null(null));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Testing nullable int with default null constant" . PHP_EOL;
@@ -96,9 +96,9 @@ float(10.7)
Testing string add val
string(14) "this is a test"
Testing int with default null constant
-int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
+TypeError: int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
Testing int with null null constant
-int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
+TypeError: int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d
Testing nullable int with default null constant
NULL
Testing nullable int with null null constant
diff --git a/Zend/tests/type_declarations/scalar_none.phpt b/Zend/tests/type_declarations/scalar_none.phpt
index 8316b51fa9ef..d92aad930295 100644
--- a/Zend/tests/type_declarations/scalar_none.phpt
+++ b/Zend/tests/type_declarations/scalar_none.phpt
@@ -19,20 +19,20 @@ foreach ($functions as $type => $function) {
try {
var_dump($function());
} catch (Throwable $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
echo PHP_EOL . "Done";
?>
--EXPECTF--
Testing int:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing float:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing string:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing bool:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing int nullable:
NULL
Testing float nullable:
diff --git a/Zend/tests/type_declarations/scalar_null.phpt b/Zend/tests/type_declarations/scalar_null.phpt
index f69aec3b5b6e..34c304619d15 100644
--- a/Zend/tests/type_declarations/scalar_null.phpt
+++ b/Zend/tests/type_declarations/scalar_null.phpt
@@ -19,7 +19,7 @@ foreach ($functions as $type => $function) {
try {
var_dump($function(null));
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -27,13 +27,13 @@ echo PHP_EOL . "Done";
?>
--EXPECTF--
Testing int:
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
Testing float:
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
Testing string:
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
Testing bool:
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
Testing int nullable:
NULL
Testing float nullable:
diff --git a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
index 498092e8ac54..655937065908 100644
--- a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
+++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
@@ -55,7 +55,7 @@ foreach ($functions as $type => $function) {
try {
var_dump($function($value));
} catch (TypeError $e) {
- echo "*** Caught ", $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), PHP_EOL;
}
}
}
@@ -74,32 +74,32 @@ int(1)
E_DEPRECATED: Implicit conversion from float 1.5 to int loses precision on line %d
int(1)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
*** Trying int(9223372036854775807)
int(9223372036854775807)
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Return value must be of type int, float returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, float returned in %s on line %d
*** Trying bool(true)
int(1)
*** Trying bool(false)
int(0)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type int, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type int, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type int, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type int, StringCapable returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, StringCapable returned in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type int, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, resource returned in %s on line %d
Testing 'float' type:
*** Trying int(1)
@@ -111,11 +111,11 @@ float(1)
*** Trying float(1.5)
float(1.5)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
*** Trying int(9223372036854775807)
float(9.223372036854776E+18)
*** Trying float(NAN)
@@ -125,18 +125,18 @@ float(1)
*** Trying bool(false)
float(0)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type float, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type float, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type float, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type float, StringCapable returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, StringCapable returned in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type float, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, resource returned in %s on line %d
Testing 'string' type:
*** Trying int(1)
@@ -163,18 +163,18 @@ string(1) "1"
*** Trying bool(false)
string(0) ""
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type string, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type string, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type string, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
string(6) "foobar"
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type string, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, resource returned in %s on line %d
Testing 'bool' type:
*** Trying int(1)
@@ -201,17 +201,17 @@ bool(true)
*** Trying bool(false)
bool(false)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type bool, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type bool, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type bool, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type bool, StringCapable returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, StringCapable returned in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type bool, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, resource returned in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict_64bit.phpt b/Zend/tests/type_declarations/scalar_strict_64bit.phpt
index b7f2ce0de439..8bf86e34b985 100644
--- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt
+++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt
@@ -46,7 +46,7 @@ foreach ($functions as $type => $function) {
try {
var_dump($function($value));
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}
@@ -60,52 +60,52 @@ Testing 'int' type:
int(1)
*** Trying string(1) "1"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying float(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying int(9223372036854775807)
int(9223372036854775807)
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
*** Trying bool(false)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
Testing 'float' type:
@@ -113,7 +113,7 @@ Testing 'float' type:
float(1)
*** Trying string(1) "1"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying float(1)
float(1)
@@ -122,13 +122,13 @@ float(1)
float(1.5)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying int(9223372036854775807)
float(9.223372036854776E+18)
@@ -137,42 +137,42 @@ float(9.223372036854776E+18)
float(NAN)
*** Trying bool(true)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
*** Trying bool(false)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
Testing 'string' type:
*** Trying int(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
*** Trying string(1) "1"
string(1) "1"
*** Trying float(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying string(2) "1a"
string(2) "1a"
@@ -184,63 +184,63 @@ string(1) "a"
string(0) ""
*** Trying int(9223372036854775807)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
*** Trying bool(false)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
Testing 'bool' type:
*** Trying int(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
*** Trying string(1) "1"
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying float(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying int(9223372036854775807)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying bool(true)
bool(true)
@@ -249,21 +249,21 @@ bool(true)
bool(false)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt
index 462bed7983d6..d9235b54b270 100644
--- a/Zend/tests/type_declarations/scalar_strict_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt
@@ -44,7 +44,7 @@ foreach ($functions as $type => $function) {
try {
var_dump($function($value));
} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}
@@ -57,28 +57,28 @@ Testing 'int' type:
int(1)
*** Trying float value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying string value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying true value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
*** Trying false value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
Testing 'float' type:
@@ -89,65 +89,65 @@ float(1)
float(1)
*** Trying string value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying true value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
*** Trying false value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
Testing 'string' type:
*** Trying integer value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
*** Trying float value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying string value
string(1) "1"
*** Trying true value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
*** Trying false value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
Testing 'bool' type:
*** Trying integer value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
*** Trying float value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying string value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying true value
bool(true)
@@ -156,15 +156,15 @@ bool(true)
bool(false)
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/static_type_return.phpt b/Zend/tests/type_declarations/static_type_return.phpt
index 0d37a8004650..4baa1c6a4157 100644
--- a/Zend/tests/type_declarations/static_type_return.phpt
+++ b/Zend/tests/type_declarations/static_type_return.phpt
@@ -37,7 +37,7 @@ var_dump($a->test2());
try {
var_dump($b->test2());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -49,7 +49,7 @@ var_dump($a->test4());
try {
var_dump($b->test4());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -60,7 +60,7 @@ $test = function($x): static {
try {
var_dump($test(new stdClass));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$test = $test->bindTo($a);
@@ -75,7 +75,7 @@ object(B)#%d (0) {
object(A)#%d (0) {
}
-A::test2(): Return value must be of type B, A returned
+TypeError: A::test2(): Return value must be of type B, A returned
object(A)#%d (0) {
}
@@ -84,8 +84,8 @@ object(C)#%d (0) {
object(A)#%d (0) {
}
-A::test4(): Return value must be of type B|array, A returned
+TypeError: A::test4(): Return value must be of type B|array, A returned
-{closure:%s:%d}(): Return value must be of type static, stdClass returned
+TypeError: {closure:%s:%d}(): Return value must be of type static, stdClass returned
object(A)#%d (0) {
}
diff --git a/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt b/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt
index dd4957f2269c..174f35b9be87 100644
--- a/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt
@@ -8,11 +8,11 @@ try {
public const int X = 1;
});
} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && new class {
+AssertionError: assert(false && new class {
public const int X = 1;
})
diff --git a/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt b/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt
index 059c3cb2005b..59e78e532855 100644
--- a/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt
@@ -9,8 +9,8 @@ class A {
try {
define("C", new A());
} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined constant "C"
+Error: Undefined constant "C"
diff --git a/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt b/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt
index 40e079c3596e..9091bb80f9fa 100644
--- a/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt
@@ -45,4 +45,4 @@ object(Z)#%d (%d) {
object(Z)#%d (%d) {
}
object(Z)#%d (%d) {
-}
\ No newline at end of file
+}
diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt
index 714e5a00995c..16d1d32003a1 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt
@@ -13,9 +13,9 @@ enum E2 {
try {
var_dump(E1::C);
} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign E2 to class constant E1::C of type static
+TypeError: Cannot assign E2 to class constant E1::C of type static
diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt
index 8acffaa38399..8877f3091218 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt
@@ -11,16 +11,16 @@ define("C", "c");
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign string to class constant A::CONST1 of type int
-Cannot assign string to class constant A::CONST1 of type int
+TypeError: Cannot assign string to class constant A::CONST1 of type int
+TypeError: Cannot assign string to class constant A::CONST1 of type int
diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt
index 1e6ab277dec8..0a8640449b0d 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt
@@ -11,15 +11,15 @@ define('C', new stdClass);
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign stdClass to class constant A::CONST1 of type string
-Cannot assign stdClass to class constant A::CONST1 of type string
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type string
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type string
diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt
index 6fce75016630..4f0e4d15172e 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt
@@ -11,15 +11,15 @@ define("C", new stdClass);
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
-Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt
index cbd3720a5ea4..192febf09c7b 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt
@@ -12,29 +12,29 @@ define("C", new stdClass);
try {
var_dump(A::CONST2);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST2);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
-Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
-Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
-Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
+TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable
diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt
index b0f42b2078a5..6ded91b21231 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt
@@ -18,8 +18,8 @@ define("S", new S());
try {
var_dump(A::S);
} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign S to class constant A::S of type string
+TypeError: Cannot assign S to class constant A::S of type string
diff --git a/Zend/tests/type_declarations/typed_properties_019.phpt b/Zend/tests/type_declarations/typed_properties_019.phpt
index d804b9c799d1..0f9fd4648d40 100644
--- a/Zend/tests/type_declarations/typed_properties_019.phpt
+++ b/Zend/tests/type_declarations/typed_properties_019.phpt
@@ -15,8 +15,8 @@ $foo = new Foo();
try {
$foo->inc();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot increment property Foo::$bar of type int past its maximal value
+TypeError: Cannot increment property Foo::$bar of type int past its maximal value
diff --git a/Zend/tests/type_declarations/typed_properties_020.phpt b/Zend/tests/type_declarations/typed_properties_020.phpt
index 3b16a9d81d0e..3f2e41a9b13c 100644
--- a/Zend/tests/type_declarations/typed_properties_020.phpt
+++ b/Zend/tests/type_declarations/typed_properties_020.phpt
@@ -12,7 +12,7 @@ class Foo {
try {
$this->bar += 1.5;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -22,5 +22,5 @@ $foo = new Foo();
var_dump($foo->bar);
?>
--EXPECT--
-Cannot assign float to property Foo::$bar of type int
+TypeError: Cannot assign float to property Foo::$bar of type int
int(2)
diff --git a/Zend/tests/type_declarations/typed_properties_021.phpt b/Zend/tests/type_declarations/typed_properties_021.phpt
index d4d4d0ed19d2..eaea976b1bf2 100644
--- a/Zend/tests/type_declarations/typed_properties_021.phpt
+++ b/Zend/tests/type_declarations/typed_properties_021.phpt
@@ -9,8 +9,8 @@ class Foo {
try {
$foo = new Foo();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Class "BAR" not found
+Error: Class "BAR" not found
diff --git a/Zend/tests/type_declarations/typed_properties_033.phpt b/Zend/tests/type_declarations/typed_properties_033.phpt
index 665026f07565..f3764d0fd746 100644
--- a/Zend/tests/type_declarations/typed_properties_033.phpt
+++ b/Zend/tests/type_declarations/typed_properties_033.phpt
@@ -20,12 +20,12 @@ try {
foreach ($foo->fetch() as &$prop) {
$prop += 1;
}
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($foo);
?>
--EXPECTF--
-Cannot assign float to reference held by property class@anonymous::$qux of type int
+TypeError: Cannot assign float to reference held by property class@anonymous::$qux of type int
object(class@anonymous)#1 (4) {
["foo"]=>
int(2)
diff --git a/Zend/tests/type_declarations/typed_properties_034.phpt b/Zend/tests/type_declarations/typed_properties_034.phpt
index 4af6baa80aef..b591a87dae4b 100644
--- a/Zend/tests/type_declarations/typed_properties_034.phpt
+++ b/Zend/tests/type_declarations/typed_properties_034.phpt
@@ -22,7 +22,7 @@ foo($foo->bar);
try {
$foo->baz = &$foo->bar;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
$foo->bar = 10;
foreach ($foo->getIterator() as &$item) {
@@ -32,17 +32,17 @@ foreach ($foo->getIterator() as &$item) {
try {
foo($foo->bar);
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($foo);
?>
--EXPECT--
int(42)
-Cannot assign null to property class@anonymous::$baz of type int
+TypeError: Cannot assign null to property class@anonymous::$baz of type int
int(1)
int(10)
int(10)
-Cannot assign null to reference held by property class@anonymous::$baz of type int
+TypeError: Cannot assign null to reference held by property class@anonymous::$baz of type int
object(class@anonymous)#1 (2) {
["bar"]=>
&int(10)
diff --git a/Zend/tests/type_declarations/typed_properties_038.phpt b/Zend/tests/type_declarations/typed_properties_038.phpt
index 4bb5b75a28fe..fe4a90b70e69 100644
--- a/Zend/tests/type_declarations/typed_properties_038.phpt
+++ b/Zend/tests/type_declarations/typed_properties_038.phpt
@@ -10,7 +10,7 @@ $foo = new class {
try {
$foo->bar++;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
@@ -18,7 +18,7 @@ var_dump($foo);
try {
$foo->bar += 1;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
@@ -26,7 +26,7 @@ var_dump($foo);
try {
++$foo->bar;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
@@ -34,28 +34,28 @@ var_dump($foo);
try {
$foo->bar = $foo->bar + 1;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
?>
--EXPECTF--
-string(82) "Cannot increment property class@anonymous::$bar of type int past its maximal value"
+TypeError: Cannot increment property class@anonymous::$bar of type int past its maximal value
object(class@anonymous)#1 (1) {
["bar"]=>
int(%d)
}
-string(65) "Cannot assign float to property class@anonymous::$bar of type int"
+TypeError: Cannot assign float to property class@anonymous::$bar of type int
object(class@anonymous)#1 (1) {
["bar"]=>
int(%d)
}
-string(82) "Cannot increment property class@anonymous::$bar of type int past its maximal value"
+TypeError: Cannot increment property class@anonymous::$bar of type int past its maximal value
object(class@anonymous)#1 (1) {
["bar"]=>
int(%d)
}
-string(65) "Cannot assign float to property class@anonymous::$bar of type int"
+TypeError: Cannot assign float to property class@anonymous::$bar of type int
object(class@anonymous)#1 (1) {
["bar"]=>
int(%d)
diff --git a/Zend/tests/type_declarations/typed_properties_043.phpt b/Zend/tests/type_declarations/typed_properties_043.phpt
index ed4951f39c37..a5fc81f99346 100644
--- a/Zend/tests/type_declarations/typed_properties_043.phpt
+++ b/Zend/tests/type_declarations/typed_properties_043.phpt
@@ -12,17 +12,17 @@ trait Test {
try {
Test::$selfProp = new stdClass;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::$selfNullProp = new stdClass;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::$parentProp = new stdClass;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
Test::$selfNullProp = null;
@@ -42,13 +42,13 @@ var_dump(Bar::$selfProp, Bar::$selfNullProp, Bar::$parentProp);
?>
--EXPECTF--
Deprecated: Accessing static trait property Test::$selfProp is deprecated, it should only be accessed on a class using the trait in %s on line %d
-Cannot assign stdClass to property Test::$selfProp of type self
+TypeError: Cannot assign stdClass to property Test::$selfProp of type self
Deprecated: Accessing static trait property Test::$selfNullProp is deprecated, it should only be accessed on a class using the trait in %s on line %d
-Cannot assign stdClass to property Test::$selfNullProp of type ?self
+TypeError: Cannot assign stdClass to property Test::$selfNullProp of type ?self
Deprecated: Accessing static trait property Test::$parentProp is deprecated, it should only be accessed on a class using the trait in %s on line %d
-Cannot assign stdClass to property Test::$parentProp of type parent
+TypeError: Cannot assign stdClass to property Test::$parentProp of type parent
Deprecated: Accessing static trait property Test::$selfNullProp is deprecated, it should only be accessed on a class using the trait in %s on line %d
diff --git a/Zend/tests/type_declarations/typed_properties_044.phpt b/Zend/tests/type_declarations/typed_properties_044.phpt
index f32cd928444e..9933c15203a4 100644
--- a/Zend/tests/type_declarations/typed_properties_044.phpt
+++ b/Zend/tests/type_declarations/typed_properties_044.phpt
@@ -22,13 +22,13 @@ $bar = PHP_INT_MAX;
try {
var_dump($bar++);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(++$bar);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$bar = PHP_INT_MIN;
@@ -37,13 +37,13 @@ $bar = PHP_INT_MIN;
try {
var_dump($bar--);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(--$bar);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -52,7 +52,7 @@ int(0)
int(-2)
int(-1)
int(-1)
-Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value
-Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value
-Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value
-Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value
+TypeError: Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value
diff --git a/Zend/tests/type_declarations/typed_properties_045.phpt b/Zend/tests/type_declarations/typed_properties_045.phpt
index 7e4dc8e43fef..4398bc8ab8d0 100644
--- a/Zend/tests/type_declarations/typed_properties_045.phpt
+++ b/Zend/tests/type_declarations/typed_properties_045.phpt
@@ -16,7 +16,7 @@ class Foo {
try {
$val = [];
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -34,7 +34,7 @@ foreach ($foo as $k => &$val) {
$val = [];
var_dump($foo->$k);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
$foo->test();
@@ -42,10 +42,10 @@ $foo->test();
--EXPECT--
int(0)
int(20)
-Cannot assign array to reference held by property Foo::$bar of type int
+TypeError: Cannot assign array to reference held by property Foo::$bar of type int
float(0.5)
float(20)
-Cannot assign array to reference held by property Foo::$baz of type float
+TypeError: Cannot assign array to reference held by property Foo::$baz of type float
float(0.5)
float(20)
-Cannot assign array to reference held by property Foo::$privateProp of type float
+TypeError: Cannot assign array to reference held by property Foo::$privateProp of type float
diff --git a/Zend/tests/type_declarations/typed_properties_046.phpt b/Zend/tests/type_declarations/typed_properties_046.phpt
index 2048455fe5f1..c66a69e334f4 100644
--- a/Zend/tests/type_declarations/typed_properties_046.phpt
+++ b/Zend/tests/type_declarations/typed_properties_046.phpt
@@ -18,13 +18,13 @@ for ($i = 0; $i < 5; $i++) {
try {
foo()->{bar()} = str_repeat("a", 3);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECT--
-Cannot assign string to property Foo::$bbb of type int
-Cannot assign string to property Foo::$bbb of type int
-Cannot assign string to property Foo::$bbb of type int
-Cannot assign string to property Foo::$bbb of type int
-Cannot assign string to property Foo::$bbb of type int
+TypeError: Cannot assign string to property Foo::$bbb of type int
+TypeError: Cannot assign string to property Foo::$bbb of type int
+TypeError: Cannot assign string to property Foo::$bbb of type int
+TypeError: Cannot assign string to property Foo::$bbb of type int
+TypeError: Cannot assign string to property Foo::$bbb of type int
diff --git a/Zend/tests/type_declarations/typed_properties_047.phpt b/Zend/tests/type_declarations/typed_properties_047.phpt
index 5de7b254d993..3e5bd90f832f 100644
--- a/Zend/tests/type_declarations/typed_properties_047.phpt
+++ b/Zend/tests/type_declarations/typed_properties_047.phpt
@@ -20,12 +20,12 @@ unset($x->foo);
try {
var_dump($x->foo);
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x->foo = "ops";
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -36,5 +36,5 @@ object(Foo)#1 (1) {
NULL
int(5)
NULL
-Typed property Foo::$foo must not be accessed before initialization
-Cannot assign string to property Foo::$foo of type ?int
+Error: Typed property Foo::$foo must not be accessed before initialization
+TypeError: Cannot assign string to property Foo::$foo of type ?int
diff --git a/Zend/tests/type_declarations/typed_properties_051.phpt b/Zend/tests/type_declarations/typed_properties_051.phpt
index 37972c967b14..47103a4efac5 100644
--- a/Zend/tests/type_declarations/typed_properties_051.phpt
+++ b/Zend/tests/type_declarations/typed_properties_051.phpt
@@ -19,9 +19,9 @@ var_dump($o->a);
try {
$o->a = new C;
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
string(4) "okok"
-Cannot assign C to property A::$a of type string
+TypeError: Cannot assign C to property A::$a of type string
diff --git a/Zend/tests/type_declarations/typed_properties_056.phpt b/Zend/tests/type_declarations/typed_properties_056.phpt
index 868594b38adc..b62c7c969add 100644
--- a/Zend/tests/type_declarations/typed_properties_056.phpt
+++ b/Zend/tests/type_declarations/typed_properties_056.phpt
@@ -13,11 +13,11 @@ $o->foo = "1" . str_repeat("0", 2);
try {
$o->foo += 5;
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($o->foo);
unset($o);
?>
--EXPECT--
-Cannot assign int to property A::$foo of type string
+TypeError: Cannot assign int to property A::$foo of type string
string(3) "100"
diff --git a/Zend/tests/type_declarations/typed_properties_057.phpt b/Zend/tests/type_declarations/typed_properties_057.phpt
index eb565f0c36b4..140eaf4b45ef 100644
--- a/Zend/tests/type_declarations/typed_properties_057.phpt
+++ b/Zend/tests/type_declarations/typed_properties_057.phpt
@@ -13,19 +13,19 @@ $o->foo = "1" . str_repeat("0", 2);
try {
$x = ++$o->foo;
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($o->foo);
try {
$x = $o->foo++;
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($o->foo);
unset($o);
?>
--EXPECT--
-Cannot assign int to property A::$foo of type string
+TypeError: Cannot assign int to property A::$foo of type string
string(3) "100"
-Cannot assign int to property A::$foo of type string
+TypeError: Cannot assign int to property A::$foo of type string
string(3) "100"
diff --git a/Zend/tests/type_declarations/typed_properties_058.phpt b/Zend/tests/type_declarations/typed_properties_058.phpt
index 47c75037d163..0934d7de0f6b 100644
--- a/Zend/tests/type_declarations/typed_properties_058.phpt
+++ b/Zend/tests/type_declarations/typed_properties_058.phpt
@@ -22,11 +22,11 @@ for ($i = 0; $i < 2; $i++) {
$o = new B();
var_dump($o->foo);
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECT--
int(5)
-Cannot assign int to property B::$foo of type string
-Cannot assign int to property B::$foo of type string
+TypeError: Cannot assign int to property B::$foo of type string
+TypeError: Cannot assign int to property B::$foo of type string
diff --git a/Zend/tests/type_declarations/typed_properties_062.phpt b/Zend/tests/type_declarations/typed_properties_062.phpt
index 6e1242e9901e..82f3896668d8 100644
--- a/Zend/tests/type_declarations/typed_properties_062.phpt
+++ b/Zend/tests/type_declarations/typed_properties_062.phpt
@@ -18,7 +18,7 @@ var_dump($a->foo);
try {
$a->_ .= "e50";
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->foo);
$a->_--;
@@ -31,30 +31,30 @@ $a->foo = PHP_INT_MIN;
try {
$a->_--;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$a->_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$a->foo = PHP_INT_MAX;
try {
$a->_++;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$a->_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$a->_ = 0;
try {
$a->_ = [];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->foo);
$a->_ = 1;
@@ -64,18 +64,18 @@ var_dump($a->foo);
--EXPECT--
int(2)
int(21)
-Cannot assign string to reference held by property class@anonymous::$foo of type int
+TypeError: Cannot assign string to reference held by property class@anonymous::$foo of type int
int(21)
int(20)
int(19)
-Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
integer
-Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
integer
-Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
integer
-Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
integer
-Cannot assign array to reference held by property class@anonymous::$foo of type int
+TypeError: Cannot assign array to reference held by property class@anonymous::$foo of type int
int(0)
int(1)
diff --git a/Zend/tests/type_declarations/typed_properties_063.phpt b/Zend/tests/type_declarations/typed_properties_063.phpt
index b67e95c24b39..141fc114387d 100644
--- a/Zend/tests/type_declarations/typed_properties_063.phpt
+++ b/Zend/tests/type_declarations/typed_properties_063.phpt
@@ -17,7 +17,7 @@ var_dump($a->foo);
try {
$_ .= "e50";
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->foo);
$_--;
@@ -30,30 +30,30 @@ $a->foo = PHP_INT_MIN;
try {
$_--;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$a->foo = PHP_INT_MAX;
try {
$_++;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$_ = 0;
try {
$_ = [];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->foo);
$_ = 1;
@@ -63,18 +63,18 @@ var_dump($a->foo);
--EXPECT--
int(2)
int(21)
-Cannot assign string to reference held by property class@anonymous::$foo of type int
+TypeError: Cannot assign string to reference held by property class@anonymous::$foo of type int
int(21)
int(20)
int(19)
-Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
integer
-Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
integer
-Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
integer
-Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
integer
-Cannot assign array to reference held by property class@anonymous::$foo of type int
+TypeError: Cannot assign array to reference held by property class@anonymous::$foo of type int
int(0)
int(1)
diff --git a/Zend/tests/type_declarations/typed_properties_064.phpt b/Zend/tests/type_declarations/typed_properties_064.phpt
index dd7b5517a7f1..daf648bfb51d 100644
--- a/Zend/tests/type_declarations/typed_properties_064.phpt
+++ b/Zend/tests/type_declarations/typed_properties_064.phpt
@@ -17,7 +17,7 @@ var_dump($a->foo);
try {
$_[0] .= "e50";
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->foo);
$_[0]--;
@@ -30,30 +30,30 @@ $a->foo = PHP_INT_MIN;
try {
$_[0]--;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$_[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$a->foo = PHP_INT_MAX;
try {
$_[0]++;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$_[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$_[0] = 0;
try {
$_[0] = [];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->foo);
$_[0] = 1;
@@ -63,18 +63,18 @@ var_dump($a->foo);
--EXPECT--
int(2)
int(21)
-Cannot assign string to reference held by property class@anonymous::$foo of type int
+TypeError: Cannot assign string to reference held by property class@anonymous::$foo of type int
int(21)
int(20)
int(19)
-Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
integer
-Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value
integer
-Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
integer
-Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value
integer
-Cannot assign array to reference held by property class@anonymous::$foo of type int
+TypeError: Cannot assign array to reference held by property class@anonymous::$foo of type int
int(0)
int(1)
diff --git a/Zend/tests/type_declarations/typed_properties_065.phpt b/Zend/tests/type_declarations/typed_properties_065.phpt
index a3a536da07e1..9b12d117b34a 100644
--- a/Zend/tests/type_declarations/typed_properties_065.phpt
+++ b/Zend/tests/type_declarations/typed_properties_065.phpt
@@ -31,24 +31,24 @@ $a->foo = PHP_INT_MIN;
try {
$a[0]--;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$a[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$a->foo = PHP_INT_MAX;
try {
$a[0]++;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$a[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
?>
@@ -61,11 +61,11 @@ offsetSet(1e50)
int(1)
int(0)
int(-1)
-Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value
integer
-Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value
integer
-Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value
integer
-Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value
integer
diff --git a/Zend/tests/type_declarations/typed_properties_068.phpt b/Zend/tests/type_declarations/typed_properties_068.phpt
index 38597559cf04..0594dcae99f9 100644
--- a/Zend/tests/type_declarations/typed_properties_068.phpt
+++ b/Zend/tests/type_declarations/typed_properties_068.phpt
@@ -28,12 +28,12 @@ var_dump($i, Foo::$i);
try {
$i = null;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($i, Foo::$i);
try {
Foo::$i = null;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($i, Foo::$i);
Foo::$s = &ref(5);
@@ -44,17 +44,17 @@ var_dump(Foo::$i, ref());
try {
Foo::$i = &ref("x");
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(Foo::$i, ref());
try {
Foo::$i = &Foo::$s;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(Foo::$i, Foo::$s);
try {
Foo::$s = &Foo::$i;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(Foo::$i, Foo::$s);
?>
@@ -66,22 +66,22 @@ int(3)
int(3)
int(4)
int(4)
-Cannot assign null to reference held by property Foo::$i of type int
+TypeError: Cannot assign null to reference held by property Foo::$i of type int
int(4)
int(4)
-Cannot assign null to property Foo::$i of type int
+TypeError: Cannot assign null to property Foo::$i of type int
int(4)
int(4)
string(1) "5"
string(1) "5"
int(0)
int(0)
-Cannot assign string to property Foo::$i of type int
+TypeError: Cannot assign string to property Foo::$i of type int
int(0)
string(1) "x"
-Reference with value of type string held by property Foo::$s of type string is not compatible with property Foo::$i of type int
+TypeError: Reference with value of type string held by property Foo::$s of type string is not compatible with property Foo::$i of type int
int(0)
string(1) "5"
-Reference with value of type int held by property Foo::$i of type int is not compatible with property Foo::$s of type string
+TypeError: Reference with value of type int held by property Foo::$i of type int is not compatible with property Foo::$s of type string
int(0)
string(1) "5"
diff --git a/Zend/tests/type_declarations/typed_properties_069.phpt b/Zend/tests/type_declarations/typed_properties_069.phpt
index 7d84407102d9..4d961c6c113d 100644
--- a/Zend/tests/type_declarations/typed_properties_069.phpt
+++ b/Zend/tests/type_declarations/typed_properties_069.phpt
@@ -14,14 +14,14 @@ class Foo {
try {
Foo::$i = &nonNumericStringRef();
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try {
var_dump(Foo::$i);
-} catch (Error $e) { print $e->getMessage()."\n"; }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(nonNumericStringRef());
?>
--EXPECT--
-Cannot assign string to property Foo::$i of type int
-Typed static property Foo::$i must not be accessed before initialization
+TypeError: Cannot assign string to property Foo::$i of type int
+Error: Typed static property Foo::$i must not be accessed before initialization
string(1) "x"
diff --git a/Zend/tests/type_declarations/typed_properties_070.phpt b/Zend/tests/type_declarations/typed_properties_070.phpt
index d039fca3b143..49bcc7a43735 100644
--- a/Zend/tests/type_declarations/typed_properties_070.phpt
+++ b/Zend/tests/type_declarations/typed_properties_070.phpt
@@ -29,12 +29,12 @@ var_dump(Foo::$i);
try {
Foo::$i += PHP_INT_MAX;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(Foo::$i);
try {
Foo::$i .= PHP_INT_MAX;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(Foo::$i);
?>
@@ -43,7 +43,7 @@ string(2) "11"
string(2) "13"
string(2) "12"
int(1)
-Cannot assign float to property Foo::$i of type int
+TypeError: Cannot assign float to property Foo::$i of type int
int(1)
-Cannot assign string to property Foo::$i of type int
+TypeError: Cannot assign string to property Foo::$i of type int
int(1)
diff --git a/Zend/tests/type_declarations/typed_properties_074.phpt b/Zend/tests/type_declarations/typed_properties_074.phpt
index 3f98e72f7366..aa7e4cff8e33 100644
--- a/Zend/tests/type_declarations/typed_properties_074.phpt
+++ b/Zend/tests/type_declarations/typed_properties_074.phpt
@@ -18,7 +18,7 @@ unset($test->val);
var_dump($test);
try {
var_dump($test->val);
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($test);
$test->prop = "y";
@@ -32,7 +32,7 @@ object(Test)#1 (1) {
["val"]=>
uninitialized(int)
}
-Value of type string returned from Test::__get() must be compatible with unset property Test::$val of type int
+TypeError: Value of type string returned from Test::__get() must be compatible with unset property Test::$val of type int
object(Test)#1 (1) {
["prop"]=>
&string(1) "x"
diff --git a/Zend/tests/type_declarations/typed_properties_075.phpt b/Zend/tests/type_declarations/typed_properties_075.phpt
index 42e74ebce441..d674a736d451 100644
--- a/Zend/tests/type_declarations/typed_properties_075.phpt
+++ b/Zend/tests/type_declarations/typed_properties_075.phpt
@@ -12,7 +12,7 @@ class Foo {
try {
Foo::$bar++;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
@@ -20,7 +20,7 @@ var_dump(Foo::$bar);
try {
Foo::$bar += 1;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
@@ -28,7 +28,7 @@ var_dump(Foo::$bar);
try {
++Foo::$bar;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
@@ -36,18 +36,18 @@ var_dump(Foo::$bar);
try {
Foo::$bar = Foo::$bar + 1;
} catch(TypeError $t) {
- var_dump($t->getMessage());
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
?>
--EXPECT--
-string(70) "Cannot increment property Foo::$bar of type int past its maximal value"
+TypeError: Cannot increment property Foo::$bar of type int past its maximal value
int(9223372036854775807)
-string(53) "Cannot assign float to property Foo::$bar of type int"
+TypeError: Cannot assign float to property Foo::$bar of type int
int(9223372036854775807)
-string(70) "Cannot increment property Foo::$bar of type int past its maximal value"
+TypeError: Cannot increment property Foo::$bar of type int past its maximal value
int(9223372036854775807)
-string(53) "Cannot assign float to property Foo::$bar of type int"
+TypeError: Cannot assign float to property Foo::$bar of type int
int(9223372036854775807)
diff --git a/Zend/tests/type_declarations/typed_properties_076.phpt b/Zend/tests/type_declarations/typed_properties_076.phpt
index b0d0bfedf808..da3346458308 100644
--- a/Zend/tests/type_declarations/typed_properties_076.phpt
+++ b/Zend/tests/type_declarations/typed_properties_076.phpt
@@ -37,13 +37,13 @@ function valid(Test $test, string $prop1, string $prop2, $value) {
$test->$prop2 = $value;
$test->$prop1 =& $test->$prop2;
} catch (TypeError $e) {
- echo "Valid assignment $prop1 =& $prop2 threw {$e->getMessage()}\n";
+ echo "Valid assignment $prop1 =& $prop2 ", $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->$prop1 = $value;
$test->$prop2 =& $test->$prop1;
} catch (TypeError $e) {
- echo "Valid assignment $prop2 =& $prop1 threw {$e->getMessage()}\n";
+ echo "Valid assignment $prop2 =& $prop1 ", $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/type_declarations/typed_properties_078.phpt b/Zend/tests/type_declarations/typed_properties_078.phpt
index 07e9384b6f54..dd1e772c3f94 100644
--- a/Zend/tests/type_declarations/typed_properties_078.phpt
+++ b/Zend/tests/type_declarations/typed_properties_078.phpt
@@ -16,7 +16,7 @@ var_dump($ref);
try {
$a->t = &$ref;
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($ref);
$a->it = [1]; // type is still assignable
@@ -24,7 +24,7 @@ var_dump($ref);
try {
$ref = new ArrayIterator();
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($ref instanceof ArrayIterator);
unset($a->a);
@@ -35,7 +35,7 @@ $a->t = &$ref;
try {
$ref = [];
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($ref instanceof ArrayIterator);
$ref = new ArrayIterator();
@@ -45,15 +45,15 @@ var_dump($ref instanceof ArrayIterator);
--EXPECT--
array(0) {
}
-string(72) "Cannot assign array to property class@anonymous::$t of type ?Traversable"
+TypeError: Cannot assign array to property class@anonymous::$t of type ?Traversable
array(0) {
}
array(1) {
[0]=>
int(1)
}
-string(92) "Cannot assign ArrayIterator to reference held by property class@anonymous::$a of type ?array"
+TypeError: Cannot assign ArrayIterator to reference held by property class@anonymous::$a of type ?array
bool(false)
-string(90) "Cannot assign array to reference held by property class@anonymous::$t of type ?Traversable"
+TypeError: Cannot assign array to reference held by property class@anonymous::$t of type ?Traversable
bool(false)
bool(true)
diff --git a/Zend/tests/type_declarations/typed_properties_079.phpt b/Zend/tests/type_declarations/typed_properties_079.phpt
index d189cec6d4ce..f734885fa2c7 100644
--- a/Zend/tests/type_declarations/typed_properties_079.phpt
+++ b/Zend/tests/type_declarations/typed_properties_079.phpt
@@ -12,7 +12,7 @@ A::$a = &A::$it;
try {
A::$it = new ArrayIterator();
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(A::$it);
A::$a = &$a;
@@ -21,13 +21,13 @@ A::$it = new ArrayIterator();
try {
$a = 1;
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a);
?>
--EXPECT--
-string(78) "Cannot assign ArrayIterator to reference held by property A::$a of type ?array"
+TypeError: Cannot assign ArrayIterator to reference held by property A::$a of type ?array
array(0) {
}
-string(68) "Cannot assign int to reference held by property A::$a of type ?array"
+TypeError: Cannot assign int to reference held by property A::$a of type ?array
NULL
diff --git a/Zend/tests/type_declarations/typed_properties_080.phpt b/Zend/tests/type_declarations/typed_properties_080.phpt
index 58a17a1a965f..21977ab0b822 100644
--- a/Zend/tests/type_declarations/typed_properties_080.phpt
+++ b/Zend/tests/type_declarations/typed_properties_080.phpt
@@ -12,17 +12,17 @@ class Test {
try {
self::$a;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::$b;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::$c;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -31,6 +31,6 @@ Test::run();
?>
--EXPECT--
-Typed static property Test::$a must not be accessed before initialization
-Typed static property Test::$b must not be accessed before initialization
-Typed static property Test::$c must not be accessed before initialization
+Error: Typed static property Test::$a must not be accessed before initialization
+Error: Typed static property Test::$b must not be accessed before initialization
+Error: Typed static property Test::$c must not be accessed before initialization
diff --git a/Zend/tests/type_declarations/typed_properties_081.phpt b/Zend/tests/type_declarations/typed_properties_081.phpt
index f6d2114c6f25..ebab48f5156b 100644
--- a/Zend/tests/type_declarations/typed_properties_081.phpt
+++ b/Zend/tests/type_declarations/typed_properties_081.phpt
@@ -13,10 +13,10 @@ $test2 = clone $test;
unset($test);
try {
$x = "foo";
-} catch (TypeError $e) { echo $e->getMessage(), "\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($test2->x);
?>
--EXPECT--
-Cannot assign string to reference held by property Test::$x of type int
+TypeError: Cannot assign string to reference held by property Test::$x of type int
int(42)
diff --git a/Zend/tests/type_declarations/typed_properties_082.phpt b/Zend/tests/type_declarations/typed_properties_082.phpt
index d212f1852cbf..cdafa31b6cba 100644
--- a/Zend/tests/type_declarations/typed_properties_082.phpt
+++ b/Zend/tests/type_declarations/typed_properties_082.phpt
@@ -14,7 +14,7 @@ class Test2 extends Test {
$x =& Test::$x;
try {
$x = "foo";
-} catch (TypeError $e) { echo $e->getMessage(), "\n"; }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($x, Test::$x);
Test::$x =& Test2::$y; // remove the typed ref from $x
@@ -23,7 +23,7 @@ var_dump($x, Test::$x);
?>
--EXPECT--
-Cannot assign string to reference held by property Test::$x of type int
+TypeError: Cannot assign string to reference held by property Test::$x of type int
int(0)
int(0)
string(3) "foo"
diff --git a/Zend/tests/type_declarations/typed_properties_083.phpt b/Zend/tests/type_declarations/typed_properties_083.phpt
index f67eec302a4e..611e07beb30e 100644
--- a/Zend/tests/type_declarations/typed_properties_083.phpt
+++ b/Zend/tests/type_declarations/typed_properties_083.phpt
@@ -17,15 +17,15 @@ var_dump($a->i);
try {
$a->p[] = "test";
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { // must be uninit
var_dump($a->p); // WRONG!
-} catch (Error $e) { var_dump($e->getMessage()); }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
$a->p = null;
try {
$a->p[] = "test";
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($a->p);
Foo::$a["bar"] = 2;
@@ -33,10 +33,10 @@ var_dump(Foo::$a);
try {
Foo::$s["baz"][] = "baz";
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { // must be uninit
var_dump(Foo::$s);
-} catch (Error $e) { var_dump($e->getMessage()); }
+} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
Foo::$a = null;
$ref = &Foo::$a;
@@ -46,12 +46,12 @@ var_dump($ref);
$ref = &$a->p;
try {
$ref[] = "bar";
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($ref);
try {
$ref["baz"][] = "bar"; // indirect assign
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($ref);
?>
@@ -60,21 +60,21 @@ array(1) {
[0]=>
int(1)
}
-string(71) "Cannot auto-initialize an array inside property Foo::$p of type ?string"
-string(65) "Typed property Foo::$p must not be accessed before initialization"
-string(71) "Cannot auto-initialize an array inside property Foo::$p of type ?string"
+TypeError: Cannot auto-initialize an array inside property Foo::$p of type ?string
+Error: Typed property Foo::$p must not be accessed before initialization
+TypeError: Cannot auto-initialize an array inside property Foo::$p of type ?string
NULL
array(1) {
["bar"]=>
int(2)
}
-string(71) "Cannot auto-initialize an array inside property Foo::$s of type ?string"
-string(72) "Typed static property Foo::$s must not be accessed before initialization"
+TypeError: Cannot auto-initialize an array inside property Foo::$s of type ?string
+Error: Typed static property Foo::$s must not be accessed before initialization
array(1) {
[0]=>
int(3)
}
-string(91) "Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string"
+TypeError: Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string
NULL
-string(91) "Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string"
+TypeError: Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string
NULL
diff --git a/Zend/tests/type_declarations/typed_properties_093.phpt b/Zend/tests/type_declarations/typed_properties_093.phpt
index 1f4bf4cb8cae..4ecf61d57f70 100644
--- a/Zend/tests/type_declarations/typed_properties_093.phpt
+++ b/Zend/tests/type_declarations/typed_properties_093.phpt
@@ -18,13 +18,13 @@ $ref = "foobar";
try {
$test->$name =& $ref;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
?>
--EXPECT--
-Cannot assign string to property Test::$prop of type int
+TypeError: Cannot assign string to property Test::$prop of type int
object(Test)#2 (0) {
["prop"]=>
uninitialized(int)
diff --git a/Zend/tests/type_declarations/typed_properties_095.phpt b/Zend/tests/type_declarations/typed_properties_095.phpt
index 4d8e5168e15e..966edaf2bd99 100644
--- a/Zend/tests/type_declarations/typed_properties_095.phpt
+++ b/Zend/tests/type_declarations/typed_properties_095.phpt
@@ -13,14 +13,14 @@ var_dump($obj->intProp);
try {
$obj->intProp = "foobar";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->intProp = 456;
try {
$obj->classProp = $obj;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->classProp = new stdClass;
var_dump($obj);
@@ -35,14 +35,14 @@ var_dump($obj->intProp);
try {
$obj->intProp = "foobar";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->intProp = 456;
try {
$obj->classProp = $obj;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->classProp = new stdClass;
var_dump($obj);
@@ -53,7 +53,7 @@ var_dump(_ZendTestClass::$staticIntProp);
try {
_ZendTestClass::$staticIntProp = "foobar";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
_ZendTestClass::$staticIntProp = 456;
var_dump(_ZendTestClass::$staticIntProp);
@@ -61,8 +61,8 @@ var_dump(_ZendTestClass::$staticIntProp);
?>
--EXPECT--
int(123)
-Cannot assign string to property _ZendTestClass::$intProp of type int
-Cannot assign _ZendTestClass to property _ZendTestClass::$classProp of type ?stdClass
+TypeError: Cannot assign string to property _ZendTestClass::$intProp of type int
+TypeError: Cannot assign _ZendTestClass to property _ZendTestClass::$classProp of type ?stdClass
object(_ZendTestClass)#1 (3) {
["intProp"]=>
int(456)
@@ -81,8 +81,8 @@ object(_ZendTestClass)#1 (3) {
uninitialized(Iterator|(Traversable&Countable))
}
int(123)
-Cannot assign string to property _ZendTestClass::$intProp of type int
-Cannot assign Test to property _ZendTestClass::$classProp of type ?stdClass
+TypeError: Cannot assign string to property _ZendTestClass::$intProp of type int
+TypeError: Cannot assign Test to property _ZendTestClass::$classProp of type ?stdClass
object(Test)#4 (3) {
["intProp"]=>
int(456)
@@ -101,5 +101,5 @@ object(Test)#4 (3) {
uninitialized(Iterator|(Traversable&Countable))
}
int(123)
-Cannot assign string to property _ZendTestClass::$staticIntProp of type int
+TypeError: Cannot assign string to property _ZendTestClass::$staticIntProp of type int
int(456)
diff --git a/Zend/tests/type_declarations/typed_properties_096.phpt b/Zend/tests/type_declarations/typed_properties_096.phpt
index 83f086d345a5..9002fd7c9b3d 100644
--- a/Zend/tests/type_declarations/typed_properties_096.phpt
+++ b/Zend/tests/type_declarations/typed_properties_096.phpt
@@ -14,7 +14,7 @@ $ref =& $test->prop2;
try {
$test->prop =& $ref;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
@@ -31,7 +31,7 @@ var_dump($test);
?>
--EXPECT--
-Cannot assign int to property Test1::$prop of type Foobar
+TypeError: Cannot assign int to property Test1::$prop of type Foobar
object(Test1)#1 (1) {
["prop"]=>
uninitialized(Foobar)
diff --git a/Zend/tests/type_declarations/typed_properties_097.phpt b/Zend/tests/type_declarations/typed_properties_097.phpt
index 6697f2ad2755..40a3837af2a2 100644
--- a/Zend/tests/type_declarations/typed_properties_097.phpt
+++ b/Zend/tests/type_declarations/typed_properties_097.phpt
@@ -15,13 +15,13 @@ $test->foo = PHP_INT_MIN;
try {
--$test->foo;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo--;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
@@ -29,13 +29,13 @@ $test->foo = PHP_INT_MAX;
try {
++$test->foo;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo++;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
@@ -46,13 +46,13 @@ $test->foo = PHP_INT_MIN;
try {
--$test->foo;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo--;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
@@ -60,31 +60,31 @@ $test->foo = PHP_INT_MAX;
try {
++$test->foo;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo++;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
?>
--EXPECT--
-Cannot decrement property Test::$foo of type int past its minimal value
+TypeError: Cannot decrement property Test::$foo of type int past its minimal value
int(-9223372036854775808)
-Cannot decrement property Test::$foo of type int past its minimal value
+TypeError: Cannot decrement property Test::$foo of type int past its minimal value
int(-9223372036854775808)
-Cannot increment property Test::$foo of type int past its maximal value
+TypeError: Cannot increment property Test::$foo of type int past its maximal value
int(9223372036854775807)
-Cannot increment property Test::$foo of type int past its maximal value
+TypeError: Cannot increment property Test::$foo of type int past its maximal value
int(9223372036854775807)
-Cannot decrement a reference held by property Test::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property Test::$foo of type int past its minimal value
int(-9223372036854775808)
-Cannot decrement a reference held by property Test::$foo of type int past its minimal value
+TypeError: Cannot decrement a reference held by property Test::$foo of type int past its minimal value
int(-9223372036854775808)
-Cannot increment a reference held by property Test::$foo of type int past its maximal value
+TypeError: Cannot increment a reference held by property Test::$foo of type int past its maximal value
+int(9223372036854775807)
+TypeError: Cannot increment a reference held by property Test::$foo of type int past its maximal value
int(9223372036854775807)
-Cannot increment a reference held by property Test::$foo of type int past its maximal value
-int(9223372036854775807)
\ No newline at end of file
diff --git a/Zend/tests/type_declarations/typed_properties_102.phpt b/Zend/tests/type_declarations/typed_properties_102.phpt
index 83f3c26186fc..c1fe26a61552 100644
--- a/Zend/tests/type_declarations/typed_properties_102.phpt
+++ b/Zend/tests/type_declarations/typed_properties_102.phpt
@@ -12,11 +12,11 @@ Test::$prop =& Test::$intProp;
try {
Test::$prop .= "foobar";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(Test::$prop, Test::$intProp);
?>
--EXPECT--
-Cannot assign string to reference held by property Test::$intProp of type int
+TypeError: Cannot assign string to reference held by property Test::$intProp of type int
int(123)
int(123)
diff --git a/Zend/tests/type_declarations/typed_properties_105.phpt b/Zend/tests/type_declarations/typed_properties_105.phpt
index 747ff9f19052..98fca7ce7d9f 100644
--- a/Zend/tests/type_declarations/typed_properties_105.phpt
+++ b/Zend/tests/type_declarations/typed_properties_105.phpt
@@ -17,4 +17,3 @@ var_dump(array_key_exists('c', $defaults));
array(0) {
}
bool(false)
-
diff --git a/Zend/tests/type_declarations/typed_properties_106.phpt b/Zend/tests/type_declarations/typed_properties_106.phpt
index 344cfa5349ee..7276e5f33a54 100644
--- a/Zend/tests/type_declarations/typed_properties_106.phpt
+++ b/Zend/tests/type_declarations/typed_properties_106.phpt
@@ -10,17 +10,17 @@ $ref =& $obj->prop;
try {
$ref = [1];
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$ary = [1];
$ref = $ary;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($ref);
?>
--EXPECT--
-Cannot assign array to reference held by property Test::$prop of type ?Type
-Cannot assign array to reference held by property Test::$prop of type ?Type
+TypeError: Cannot assign array to reference held by property Test::$prop of type ?Type
+TypeError: Cannot assign array to reference held by property Test::$prop of type ?Type
NULL
diff --git a/Zend/tests/type_declarations/typed_properties_110.phpt b/Zend/tests/type_declarations/typed_properties_110.phpt
index 6a108b4529c6..49164c67679a 100644
--- a/Zend/tests/type_declarations/typed_properties_110.phpt
+++ b/Zend/tests/type_declarations/typed_properties_110.phpt
@@ -12,9 +12,9 @@ $foo->value = null;
try {
$foo->value = 1;
} catch (\TypeError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot assign int to property Foo::$value of type null
+TypeError: Cannot assign int to property Foo::$value of type null
diff --git a/Zend/tests/type_declarations/typed_properties_111.phpt b/Zend/tests/type_declarations/typed_properties_111.phpt
index 20236e8a19bb..e80f6a25710c 100644
--- a/Zend/tests/type_declarations/typed_properties_111.phpt
+++ b/Zend/tests/type_declarations/typed_properties_111.phpt
@@ -12,9 +12,9 @@ $foo->value = false;
try {
$foo->value = true;
} catch (\TypeError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot assign true to property Foo::$value of type false
+TypeError: Cannot assign true to property Foo::$value of type false
diff --git a/Zend/tests/type_declarations/typed_properties_112.phpt b/Zend/tests/type_declarations/typed_properties_112.phpt
index 8b1157759fec..db0a81d6c3e2 100644
--- a/Zend/tests/type_declarations/typed_properties_112.phpt
+++ b/Zend/tests/type_declarations/typed_properties_112.phpt
@@ -11,9 +11,9 @@ $foo = new Foo();
try {
$foo->value = false;
} catch (\TypeError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Cannot assign false to property Foo::$value of type true
+TypeError: Cannot assign false to property Foo::$value of type true
diff --git a/Zend/tests/type_declarations/typed_properties_114.phpt b/Zend/tests/type_declarations/typed_properties_114.phpt
index 5f3093dd3308..1d4b30184625 100644
--- a/Zend/tests/type_declarations/typed_properties_114.phpt
+++ b/Zend/tests/type_declarations/typed_properties_114.phpt
@@ -17,14 +17,14 @@ foreach ($obj as $k => &$v) {
try {
$v = [];
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
foreach ($obj as $k => &$v) {
try {
$v = [];
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -32,10 +32,10 @@ var_dump($obj);
?>
--EXPECTF--
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
-Cannot assign array to reference held by property A::$foo of type string
+TypeError: Cannot assign array to reference held by property A::$foo of type string
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
-Cannot assign array to reference held by property A::$foo of type string
+TypeError: Cannot assign array to reference held by property A::$foo of type string
object(A)#1 (1) {
["foo"]=>
&string(3) "bar"
diff --git a/Zend/tests/type_declarations/typed_properties_115.phpt b/Zend/tests/type_declarations/typed_properties_115.phpt
index 6347ee0c35d6..d929fb60dc86 100644
--- a/Zend/tests/type_declarations/typed_properties_115.phpt
+++ b/Zend/tests/type_declarations/typed_properties_115.phpt
@@ -17,14 +17,14 @@ $obj = new A;
try {
foreach ($obj as $k => &$v) {}
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($obj);
?>
--EXPECTF--
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
-Cannot acquire reference to readonly property A::$foo
+Error: Cannot acquire reference to readonly property A::$foo
object(A)#1 (1) {
["foo"]=>
string(3) "bar"
diff --git a/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt b/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt
index 72cff1058f22..ebc60be52b28 100644
--- a/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt
+++ b/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt
@@ -12,7 +12,7 @@ class Test {
try {
$this->prop = "foobar";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($this->prop);
}
@@ -24,7 +24,7 @@ $test->method();
?>
--EXPECT--
-Cannot assign string to property Test::$prop of type int
+TypeError: Cannot assign string to property Test::$prop of type int
int(1)
-Cannot assign string to property Test::$prop of type int
+TypeError: Cannot assign string to property Test::$prop of type int
int(1)
diff --git a/Zend/tests/type_declarations/typed_properties_class_loading.phpt b/Zend/tests/type_declarations/typed_properties_class_loading.phpt
index a81bc5b4fe09..a9205fb2948d 100644
--- a/Zend/tests/type_declarations/typed_properties_class_loading.phpt
+++ b/Zend/tests/type_declarations/typed_properties_class_loading.phpt
@@ -16,7 +16,7 @@ $test = new Test;
try {
$test->propX = new stdClass;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
if (true) {
@@ -31,7 +31,7 @@ $r =& $test->propY;
try {
$test->propY = new stdClass;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
if (true) {
@@ -43,9 +43,9 @@ var_dump($test->propY);
?>
--EXPECT--
-Cannot assign stdClass to property Test::$propX of type X
+TypeError: Cannot assign stdClass to property Test::$propX of type X
object(X)#3 (0) {
}
-Cannot assign stdClass to property Test::$propY of type ?Y
+TypeError: Cannot assign stdClass to property Test::$propY of type ?Y
object(Y)#4 (0) {
}
diff --git a/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt b/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt
index 5754591ce7d5..a380cac92d51 100644
--- a/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt
+++ b/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt
@@ -16,21 +16,21 @@ $test = new Test;
try {
$test->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop = "foo";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Typed property Test::$prop must not be accessed before initialization
-Cannot assign string to property Test::$prop of type int
-Typed property Test::$prop must not be accessed before initialization
+Error: Typed property Test::$prop must not be accessed before initialization
+TypeError: Cannot assign string to property Test::$prop of type int
+Error: Typed property Test::$prop must not be accessed before initialization
diff --git a/Zend/tests/type_declarations/typed_properties_magic_set.phpt b/Zend/tests/type_declarations/typed_properties_magic_set.phpt
index 70a7d4fe6f07..7c77a4adfcc6 100644
--- a/Zend/tests/type_declarations/typed_properties_magic_set.phpt
+++ b/Zend/tests/type_declarations/typed_properties_magic_set.phpt
@@ -25,7 +25,7 @@ $test = new Test;
try {
var_dump($test->foo);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(isset($test->foo));
$test->foo = 42;
@@ -61,7 +61,7 @@ $test->foo = 42;
?>
--EXPECT--
-Typed property Test::$foo must not be accessed before initialization
+Error: Typed property Test::$foo must not be accessed before initialization
bool(false)
int(42)
__set foo = 42
diff --git a/Zend/tests/type_declarations/union_types/anonymous_class.phpt b/Zend/tests/type_declarations/union_types/anonymous_class.phpt
index 1e009f22b00f..1ffec32de05e 100644
--- a/Zend/tests/type_declarations/union_types/anonymous_class.phpt
+++ b/Zend/tests/type_declarations/union_types/anonymous_class.phpt
@@ -16,15 +16,15 @@ $a = new class {
try {
$a->testParam(null);
} catch (\Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->test();
} catch (\Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-class@anonymous(): Argument #1 ($a) must be of type class@anonymous|string, null given, called in %s on line %d
-class@anonymous::test(): Return value must be of type class@anonymous|string, stdClass returned
+TypeError: class@anonymous(): Argument #1 ($a) must be of type class@anonymous|string, null given, called in %s on line %d
+TypeError: class@anonymous::test(): Return value must be of type class@anonymous|string, stdClass returned
diff --git a/Zend/tests/type_declarations/union_types/incdec_prop.phpt b/Zend/tests/type_declarations/union_types/incdec_prop.phpt
index dde6f595264a..1ed6dabda0b2 100644
--- a/Zend/tests/type_declarations/union_types/incdec_prop.phpt
+++ b/Zend/tests/type_declarations/union_types/incdec_prop.phpt
@@ -56,28 +56,28 @@ try {
$test->prop2 = PHP_INT_MAX;
$x = $test->prop2++;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MAX;
$x = ++$test->prop2;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MIN;
$x = $test->prop2--;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MIN;
$x = --$test->prop2;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -85,7 +85,7 @@ try {
$r =& $test->prop2;
$x = $test->prop2++;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -93,7 +93,7 @@ try {
$r =& $test->prop2;
$x = ++$test->prop2;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -101,7 +101,7 @@ try {
$r =& $test->prop2;
$x = $test->prop2--;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -109,7 +109,7 @@ try {
$r =& $test->prop2;
$x = --$test->prop2;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -122,11 +122,11 @@ bool(true)
bool(true)
bool(true)
bool(true)
-Cannot increment property Test::$prop2 of type int|bool past its maximal value
-Cannot increment property Test::$prop2 of type int|bool past its maximal value
-Cannot decrement property Test::$prop2 of type int|bool past its minimal value
-Cannot decrement property Test::$prop2 of type int|bool past its minimal value
-Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value
-Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value
-Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value
-Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value
+TypeError: Cannot increment property Test::$prop2 of type int|bool past its maximal value
+TypeError: Cannot increment property Test::$prop2 of type int|bool past its maximal value
+TypeError: Cannot decrement property Test::$prop2 of type int|bool past its minimal value
+TypeError: Cannot decrement property Test::$prop2 of type int|bool past its minimal value
+TypeError: Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value
+TypeError: Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value
+TypeError: Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value
+TypeError: Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value
diff --git a/Zend/tests/type_declarations/union_types/inheritance_internal.phpt b/Zend/tests/type_declarations/union_types/inheritance_internal.phpt
index 9841e34ff90d..76a9089f56c7 100644
--- a/Zend/tests/type_declarations/union_types/inheritance_internal.phpt
+++ b/Zend/tests/type_declarations/union_types/inheritance_internal.phpt
@@ -13,7 +13,7 @@ $obj->classUnionProp = new ArrayIterator;
try {
$obj->classUnionProp = new DateTime;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj = new C;
@@ -22,10 +22,10 @@ $obj->classUnionProp = new ArrayIterator;
try {
$obj->classUnionProp = new DateTime;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null
-Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null
+TypeError: Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null
+TypeError: Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null
diff --git a/Zend/tests/type_declarations/union_types/multiple_classes.phpt b/Zend/tests/type_declarations/union_types/multiple_classes.phpt
index b45fc02d83fa..4e31dd0dcb11 100644
--- a/Zend/tests/type_declarations/union_types/multiple_classes.phpt
+++ b/Zend/tests/type_declarations/union_types/multiple_classes.phpt
@@ -28,13 +28,13 @@ var_dump($test->method("42"));
try {
$test->prop = new stdClass;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->method(new stdClass);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
if (true) {
@@ -67,8 +67,8 @@ int(42)
int(42)
int(42)
int(42)
-Cannot assign stdClass to property Test::$prop of type X|Y|Z|int
-Test::method(): Argument #1 ($arg) must be of type X|Y|Z|int, stdClass given, called in %s on line %d
+TypeError: Cannot assign stdClass to property Test::$prop of type X|Y|Z|int
+TypeError: Test::method(): Argument #1 ($arg) must be of type X|Y|Z|int, stdClass given, called in %s on line %d
object(X)#4 (0) {
}
object(X)#6 (0) {
diff --git a/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt b/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt
index a8db8fca9cd5..fd262352551d 100644
--- a/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt
+++ b/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt
@@ -17,7 +17,7 @@ $v = 42;
try {
$r = $v;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($r, $v);
@@ -25,7 +25,7 @@ $v = 42.0;
try {
$r = $v;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($r, $v);
@@ -35,7 +35,7 @@ $test->x = 42;
try {
$test->y =& $test->x;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($test->x, $test->y);
@@ -44,16 +44,16 @@ $test->y = 42.0;
try {
$test->x =& $test->y;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign int to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion
+TypeError: Cannot assign int to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion
string(6) "foobar"
int(42)
-Cannot assign float to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion
+TypeError: Cannot assign float to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion
string(6) "foobar"
float(42)
-Reference with value of type int held by property Test::$x of type string|int is not compatible with property Test::$y of type string|float
-Reference with value of type float held by property Test::$y of type string|float is not compatible with property Test::$x of type string|int
+TypeError: Reference with value of type int held by property Test::$x of type string|int is not compatible with property Test::$y of type string|float
+TypeError: Reference with value of type float held by property Test::$y of type string|float is not compatible with property Test::$x of type string|int
diff --git a/Zend/tests/type_declarations/variance/loading_exception1.phpt b/Zend/tests/type_declarations/variance/loading_exception1.phpt
index ea5be4e56f05..7c0938725617 100644
--- a/Zend/tests/type_declarations/variance/loading_exception1.phpt
+++ b/Zend/tests/type_declarations/variance/loading_exception1.phpt
@@ -13,7 +13,7 @@ for ($i = 0; $i < 2; $i++) {
class B extends A {
}
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -34,13 +34,13 @@ try {
class B extends A implements I {
}
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Class A does not exist
-Class A does not exist
+Exception: Class A does not exist
+Exception: Class A does not exist
Fatal error: During inheritance of B with variance dependencies: Uncaught Exception: Class A does not exist in %s:%d
Stack trace:
diff --git a/Zend/tests/type_declarations/variance/loading_exception2.phpt b/Zend/tests/type_declarations/variance/loading_exception2.phpt
index db9c6b276581..63c8ca894878 100644
--- a/Zend/tests/type_declarations/variance/loading_exception2.phpt
+++ b/Zend/tests/type_declarations/variance/loading_exception2.phpt
@@ -15,7 +15,7 @@ for ($i = 0; $i < 2; $i++) {
class B extends A implements I {
}
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -36,13 +36,13 @@ try {
class B extends A implements I, J {
}
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Class I does not exist
-Class I does not exist
+Exception: Class I does not exist
+Exception: Class I does not exist
Fatal error: During inheritance of B with variance dependencies: Uncaught Exception: Class I does not exist in %s:%d
Stack trace:
diff --git a/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt b/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt
index 2b5a9c8423eb..ab0fe86106c0 100644
--- a/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt
+++ b/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt
@@ -11,9 +11,9 @@ try {
class B extends A {
}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Class "B" not found
+Error: Class "B" not found
diff --git a/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt b/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt
index 247e1cf2b10b..67c32d0c6aee 100644
--- a/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt
+++ b/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt
@@ -11,9 +11,9 @@ try {
interface B extends A {
}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Interface "B" not found
+Error: Interface "B" not found
diff --git a/Zend/tests/undef_index_to_exception.phpt b/Zend/tests/undef_index_to_exception.phpt
index bbe13c0e71d0..c9e756b3a61e 100644
--- a/Zend/tests/undef_index_to_exception.phpt
+++ b/Zend/tests/undef_index_to_exception.phpt
@@ -11,14 +11,14 @@ $test = [];
try {
$test[0] .= "xyz";
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
try {
$test["key"] .= "xyz";
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
@@ -26,21 +26,21 @@ unset($test);
try {
$GLOBALS["test"] .= "xyz";
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined array key 0
+Exception: Undefined array key 0
array(0) {
}
-Undefined array key "key"
+Exception: Undefined array key "key"
array(0) {
}
-Undefined global variable $test
-Undefined variable $test
+Exception: Undefined global variable $test
+Exception: Undefined variable $test
diff --git a/Zend/tests/undefined_multidimensional_array.phpt b/Zend/tests/undefined_multidimensional_array.phpt
index 6593d6ba4ad4..fdbd0bf5f397 100644
--- a/Zend/tests/undefined_multidimensional_array.phpt
+++ b/Zend/tests/undefined_multidimensional_array.phpt
@@ -12,7 +12,7 @@ $arr[1][2][3][4][5]->foo;
try {
$arr[1][2][3][4][5]->foo = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr[][] = 2;
@@ -20,7 +20,7 @@ $arr[][] = 2;
try {
$arr[][]->bar = 2;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -62,5 +62,5 @@ Warning: Trying to access array offset on null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
Warning: Attempt to read property "foo" on null in %s on line %d
-Attempt to assign property "foo" on null
-Attempt to assign property "bar" on null
+Error: Attempt to assign property "foo" on null
+Error: Attempt to assign property "bar" on null
diff --git a/Zend/tests/unpack_iterator_by_ref_type_check.phpt b/Zend/tests/unpack_iterator_by_ref_type_check.phpt
index 2fef31056bdc..31f31e69af27 100644
--- a/Zend/tests/unpack_iterator_by_ref_type_check.phpt
+++ b/Zend/tests/unpack_iterator_by_ref_type_check.phpt
@@ -10,9 +10,9 @@ function gen() {
try {
test(...gen());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Cannot pass by-reference argument 1 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
-test(): Argument #1 ($a) must be of type T, null given, called in %s on line %d
+TypeError: test(): Argument #1 ($a) must be of type T, null given, called in %s on line %d
diff --git a/Zend/tests/unset/unset_non_array.phpt b/Zend/tests/unset/unset_non_array.phpt
index 5d7ad4d44b87..2bd8ccaa760e 100644
--- a/Zend/tests/unset/unset_non_array.phpt
+++ b/Zend/tests/unset/unset_non_array.phpt
@@ -15,35 +15,35 @@ $x = true;
try {
unset($x[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 1;
try {
unset($x[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 3.14;
try {
unset($x[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = "str";
try {
unset($x[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = new stdClass;
try {
unset($x[0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// And now repeat the same with a nested offset.
@@ -61,35 +61,35 @@ $x = true;
try {
unset($x[0][0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 1;
try {
unset($x[0][0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 3.14;
try {
unset($x[0][0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = "str";
try {
unset($x[0][0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = new stdClass;
try {
unset($x[0][0]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -97,17 +97,17 @@ try {
Warning: Undefined variable $x in %s on line %d
Deprecated: Automatic conversion of false to array is deprecated in %s
-Cannot unset offset in a non-array variable
-Cannot unset offset in a non-array variable
-Cannot unset offset in a non-array variable
-Cannot unset string offsets
-Cannot use object of type stdClass as array
+Error: Cannot unset offset in a non-array variable
+Error: Cannot unset offset in a non-array variable
+Error: Cannot unset offset in a non-array variable
+Error: Cannot unset string offsets
+Error: Cannot use object of type stdClass as array
Warning: Undefined variable $x in %s on line %d
Deprecated: Automatic conversion of false to array is deprecated in %s
-Cannot unset offset in a non-array variable
-Cannot unset offset in a non-array variable
-Cannot unset offset in a non-array variable
-Cannot use string offset as an array
-Cannot use object of type stdClass as array
+Error: Cannot unset offset in a non-array variable
+Error: Cannot unset offset in a non-array variable
+Error: Cannot unset offset in a non-array variable
+Error: Cannot use string offset as an array
+Error: Cannot use object of type stdClass as array
diff --git a/Zend/tests/varSyntax/constant_object_deref.phpt b/Zend/tests/varSyntax/constant_object_deref.phpt
index b25d6557440d..885eb9c52bd0 100644
--- a/Zend/tests/varSyntax/constant_object_deref.phpt
+++ b/Zend/tests/varSyntax/constant_object_deref.phpt
@@ -9,16 +9,16 @@ class Bar { const FOO = "foo"; }
try {
FOO->length();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Bar::FOO->length();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to a member function length() on string
-Call to a member function length() on string
+Error: Call to a member function length() on string
+Error: Call to a member function length() on string
diff --git a/Zend/tests/varSyntax/encapsed_string_deref.phpt b/Zend/tests/varSyntax/encapsed_string_deref.phpt
index 386e15932e6b..8bbc34d18b43 100644
--- a/Zend/tests/varSyntax/encapsed_string_deref.phpt
+++ b/Zend/tests/varSyntax/encapsed_string_deref.phpt
@@ -9,7 +9,7 @@ var_dump("foo$bar"->prop);
try {
var_dump("foo$bar"->method());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class FooBar { public static $prop = 42; }
@@ -24,6 +24,6 @@ string(1) "f"
Warning: Attempt to read property "prop" on string in %s on line %d
NULL
-Call to a member function method() on string
+Error: Call to a member function method() on string
int(42)
int(42)
diff --git a/Zend/tests/varSyntax/magic_const_deref.phpt b/Zend/tests/varSyntax/magic_const_deref.phpt
index 54a5c95069ce..f2bd9db4c3c9 100644
--- a/Zend/tests/varSyntax/magic_const_deref.phpt
+++ b/Zend/tests/varSyntax/magic_const_deref.phpt
@@ -9,7 +9,7 @@ function test() {
try {
__FUNCTION__->method();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -21,4 +21,4 @@ string(1) "t"
Warning: Attempt to read property "prop" on string in %s on line %d
NULL
-Call to a member function method() on string
+Error: Call to a member function method() on string
diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt
index 7cbc02bf581c..1ca5863faa6e 100644
--- a/Zend/tests/variadic/typehint_suppressed_error.phpt
+++ b/Zend/tests/variadic/typehint_suppressed_error.phpt
@@ -10,9 +10,9 @@ function test(array... $args) {
try {
test([0], [1], 2);
} catch(Error $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-string(%d) "test(): Argument #3 must be of type array, int given, called in %s on line %d"
+TypeError: test(): Argument #3 must be of type array, int given, called in %s on line %d
diff --git a/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt b/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt
index dd3c84518eac..f6132b2f9521 100644
--- a/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt
+++ b/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt
@@ -43,7 +43,7 @@ var_dump(!empty($map[$obj]));
try {
var_dump($map[$obj]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// It's okay to unset an object that's not in the map.
@@ -138,7 +138,7 @@ object(WeakMap)#1 (0) {
}
bool(false)
bool(false)
-Object stdClass#2 not contained in WeakMap
+Error: Object stdClass#2 not contained in WeakMap
Indirect modification:
object(WeakMap)#1 (2) {
diff --git a/Zend/tests/weakrefs/weakmap_error_conditions.phpt b/Zend/tests/weakrefs/weakmap_error_conditions.phpt
index 2516c0443fd1..5813caf036c2 100644
--- a/Zend/tests/weakrefs/weakmap_error_conditions.phpt
+++ b/Zend/tests/weakrefs/weakmap_error_conditions.phpt
@@ -7,38 +7,38 @@ $map = new WeakMap;
try {
$map[1] = 2;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($map[1]);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
isset($map[1]);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($map[1]);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$map[] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$map[][1] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($map[new stdClass]);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($map->prop);
@@ -48,45 +48,45 @@ unset($map->prop);
try {
$map->prop = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$map->prop[] = 1;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$r =& $map->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
serialize($map);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unserialize('C:7:"WeakMap":0:{}');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-WeakMap key must be an object
-WeakMap key must be an object
-WeakMap key must be an object
-WeakMap key must be an object
-Cannot append to WeakMap
-Cannot append to WeakMap
-Object stdClass#2 not contained in WeakMap
+TypeError: WeakMap key must be an object
+TypeError: WeakMap key must be an object
+TypeError: WeakMap key must be an object
+TypeError: WeakMap key must be an object
+Error: Cannot append to WeakMap
+Error: Cannot append to WeakMap
+Error: Object stdClass#2 not contained in WeakMap
Warning: Undefined property: WeakMap::$prop in %s on line %d
NULL
bool(false)
-Cannot create dynamic property WeakMap::$prop
-Cannot create dynamic property WeakMap::$prop
-Cannot create dynamic property WeakMap::$prop
-Serialization of 'WeakMap' is not allowed
-Unserialization of 'WeakMap' is not allowed
+Error: Cannot create dynamic property WeakMap::$prop
+Error: Cannot create dynamic property WeakMap::$prop
+Error: Cannot create dynamic property WeakMap::$prop
+Exception: Serialization of 'WeakMap' is not allowed
+Exception: Unserialization of 'WeakMap' is not allowed
diff --git a/Zend/tests/weakrefs/weakrefs_002.phpt b/Zend/tests/weakrefs/weakrefs_002.phpt
index eda6b25ec786..be633a82836e 100644
--- a/Zend/tests/weakrefs/weakrefs_002.phpt
+++ b/Zend/tests/weakrefs/weakrefs_002.phpt
@@ -7,7 +7,7 @@ $wr = WeakReference::create(new stdClass);
try {
serialize($wr);
} catch (Exception $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$wrs = 'O:13:"WeakReference":0:{}';
@@ -15,9 +15,9 @@ $wrs = 'O:13:"WeakReference":0:{}';
try {
var_dump(unserialize($wrs));
} catch (Exception $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-string(47) "Serialization of 'WeakReference' is not allowed"
-string(49) "Unserialization of 'WeakReference' is not allowed"
+Exception: Serialization of 'WeakReference' is not allowed
+Exception: Unserialization of 'WeakReference' is not allowed
diff --git a/Zend/tests/weakrefs/weakrefs_003.phpt b/Zend/tests/weakrefs/weakrefs_003.phpt
index 42fe0560a71f..7cca6949874a 100644
--- a/Zend/tests/weakrefs/weakrefs_003.phpt
+++ b/Zend/tests/weakrefs/weakrefs_003.phpt
@@ -11,18 +11,18 @@ unset($wr->disallow);
try {
$wr->disallow = "writes";
} catch (Error $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
$disallow = &$wr->disallowed;
} catch (Error $ex) {
- var_dump($ex->getMessage());
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined property: WeakReference::$disallow in %s on line %d
NULL
bool(false)
-string(55) "Cannot create dynamic property WeakReference::$disallow"
-string(57) "Cannot create dynamic property WeakReference::$disallowed"
+Error: Cannot create dynamic property WeakReference::$disallow
+Error: Cannot create dynamic property WeakReference::$disallowed
diff --git a/Zend/tests/weakrefs/weakrefs_006.phpt b/Zend/tests/weakrefs/weakrefs_006.phpt
index a15ab6b542d5..dc432665d5c1 100644
--- a/Zend/tests/weakrefs/weakrefs_006.phpt
+++ b/Zend/tests/weakrefs/weakrefs_006.phpt
@@ -113,4 +113,4 @@ object(WeakMap)#1 (11) {
["value"]=>
int(9)
}
-}
\ No newline at end of file
+}
diff --git a/Zend/tests/xor_001.phpt b/Zend/tests/xor_001.phpt
index 9678af16b5f7..2f554c0f1e2f 100644
--- a/Zend/tests/xor_001.phpt
+++ b/Zend/tests/xor_001.phpt
@@ -9,11 +9,11 @@ $b = array();
try {
$c = $a ^ $b;
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
-Unsupported operand types: array ^ array
+TypeError: Unsupported operand types: array ^ array
Done
diff --git a/ext/bcmath/tests/bcadd_error.phpt b/ext/bcmath/tests/bcadd_error.phpt
index 320bf390680a..ffd3ba429b03 100644
--- a/ext/bcmath/tests/bcadd_error.phpt
+++ b/ext/bcmath/tests/bcadd_error.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcadd('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcadd('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #2 ($num2) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/bcceil_error.phpt b/ext/bcmath/tests/bcceil_error.phpt
index fd4c51ff6c58..58df0fdce601 100644
--- a/ext/bcmath/tests/bcceil_error.phpt
+++ b/ext/bcmath/tests/bcceil_error.phpt
@@ -7,15 +7,15 @@ bcmath
try {
bcceil('hoge');
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcceil('0.00.1');
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-bcceil(): Argument #1 ($num) is not well-formed
-bcceil(): Argument #1 ($num) is not well-formed
+ValueError: bcceil(): Argument #1 ($num) is not well-formed
+ValueError: bcceil(): Argument #1 ($num) is not well-formed
diff --git a/ext/bcmath/tests/bccomp_error.phpt b/ext/bcmath/tests/bccomp_error.phpt
index 90645c52f7e5..5a48f4e0494d 100644
--- a/ext/bcmath/tests/bccomp_error.phpt
+++ b/ext/bcmath/tests/bccomp_error.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bccomp('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bccomp('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bccomp(): Argument #1 ($num1) is not well-formed
-bccomp(): Argument #2 ($num2) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bccomp(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/bcdiv_error1.phpt b/ext/bcmath/tests/bcdiv_error1.phpt
index b6af64d69af3..fbb37ad66931 100644
--- a/ext/bcmath/tests/bcdiv_error1.phpt
+++ b/ext/bcmath/tests/bcdiv_error1.phpt
@@ -11,22 +11,22 @@ bcmath
try {
bcdiv('10.99', '0');
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
bcdiv('10.99', '0.00');
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
bcdiv('10.99', '-0.00');
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Division by zero
-Division by zero
-Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
diff --git a/ext/bcmath/tests/bcdiv_error2.phpt b/ext/bcmath/tests/bcdiv_error2.phpt
index a4e1cae35354..fb21fca2eedd 100644
--- a/ext/bcmath/tests/bcdiv_error2.phpt
+++ b/ext/bcmath/tests/bcdiv_error2.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcdiv('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcdiv('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcdiv(): Argument #1 ($num1) is not well-formed
-bcdiv(): Argument #2 ($num2) is not well-formed
+ValueError: bcdiv(): Argument #1 ($num1) is not well-formed
+ValueError: bcdiv(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/bcfloor_error.phpt b/ext/bcmath/tests/bcfloor_error.phpt
index 7578a5afe3b8..28556b366aaa 100644
--- a/ext/bcmath/tests/bcfloor_error.phpt
+++ b/ext/bcmath/tests/bcfloor_error.phpt
@@ -7,15 +7,15 @@ bcmath
try {
bcfloor('hoge');
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcfloor('0.00.1');
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-bcfloor(): Argument #1 ($num) is not well-formed
-bcfloor(): Argument #1 ($num) is not well-formed
+ValueError: bcfloor(): Argument #1 ($num) is not well-formed
+ValueError: bcfloor(): Argument #1 ($num) is not well-formed
diff --git a/ext/bcmath/tests/bcmod_error2.phpt b/ext/bcmath/tests/bcmod_error2.phpt
index 37c433fbb89c..27e724282df2 100644
--- a/ext/bcmath/tests/bcmod_error2.phpt
+++ b/ext/bcmath/tests/bcmod_error2.phpt
@@ -9,20 +9,20 @@ bcmath.scale=0
try {
bcmod("10", "0");
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
bcmod("10", "0.000");
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
bcmod("10", "-0.0");
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Modulo by zero
-Modulo by zero
-Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/bcmath/tests/bcmod_error3.phpt b/ext/bcmath/tests/bcmod_error3.phpt
index 8df986fe7654..d15c91700578 100644
--- a/ext/bcmath/tests/bcmod_error3.phpt
+++ b/ext/bcmath/tests/bcmod_error3.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcmod('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcmod('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcmod(): Argument #1 ($num1) is not well-formed
-bcmod(): Argument #2 ($num2) is not well-formed
+ValueError: bcmod(): Argument #1 ($num1) is not well-formed
+ValueError: bcmod(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/bcmul_error.phpt b/ext/bcmath/tests/bcmul_error.phpt
index 361b46163ee6..5ba15027e44c 100644
--- a/ext/bcmath/tests/bcmul_error.phpt
+++ b/ext/bcmath/tests/bcmul_error.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcmul('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcmul('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcmul(): Argument #1 ($num1) is not well-formed
-bcmul(): Argument #2 ($num2) is not well-formed
+ValueError: bcmul(): Argument #1 ($num1) is not well-formed
+ValueError: bcmul(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/bcpow_div_by_zero.phpt b/ext/bcmath/tests/bcpow_div_by_zero.phpt
index ac1e8187450c..fa5d97698d99 100644
--- a/ext/bcmath/tests/bcpow_div_by_zero.phpt
+++ b/ext/bcmath/tests/bcpow_div_by_zero.phpt
@@ -14,16 +14,16 @@ foreach ($baseNumbers as $baseNumber) {
try {
echo bcpow($baseNumber, $exponent), "\n";
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
?>
--EXPECT--
-Negative power of zero
-Negative power of zero
-Negative power of zero
-Negative power of zero
-Negative power of zero
-Negative power of zero
+DivisionByZeroError: Negative power of zero
+DivisionByZeroError: Negative power of zero
+DivisionByZeroError: Negative power of zero
+DivisionByZeroError: Negative power of zero
+DivisionByZeroError: Negative power of zero
+DivisionByZeroError: Negative power of zero
diff --git a/ext/bcmath/tests/bcpow_error1.phpt b/ext/bcmath/tests/bcpow_error1.phpt
index fefdfc57a010..1f991deb4dfa 100644
--- a/ext/bcmath/tests/bcpow_error1.phpt
+++ b/ext/bcmath/tests/bcpow_error1.phpt
@@ -7,14 +7,14 @@ bcmath
try {
var_dump(bcpow('1', '1.1', 2));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bcpow('1', '0.1', 2));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpow(): Argument #2 ($exponent) cannot have a fractional part
-bcpow(): Argument #2 ($exponent) cannot have a fractional part
+ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part
+ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part
diff --git a/ext/bcmath/tests/bcpow_error2.phpt b/ext/bcmath/tests/bcpow_error2.phpt
index f9b830ca7d5b..ac4b995201a9 100644
--- a/ext/bcmath/tests/bcpow_error2.phpt
+++ b/ext/bcmath/tests/bcpow_error2.phpt
@@ -7,15 +7,15 @@ bcmath
try {
var_dump(bcpow('0', '9223372036854775808', 2));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bcpow('0', '-9223372036854775808', 2));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpow(): Argument #2 ($exponent) is too large
-bcpow(): Argument #2 ($exponent) is too large
+ValueError: bcpow(): Argument #2 ($exponent) is too large
+ValueError: bcpow(): Argument #2 ($exponent) is too large
diff --git a/ext/bcmath/tests/bcpow_error3.phpt b/ext/bcmath/tests/bcpow_error3.phpt
index f47c85d4da86..941d2f7fae9f 100644
--- a/ext/bcmath/tests/bcpow_error3.phpt
+++ b/ext/bcmath/tests/bcpow_error3.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcpow('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcpow('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpow(): Argument #1 ($num) is not well-formed
-bcpow(): Argument #2 ($exponent) is not well-formed
+ValueError: bcpow(): Argument #1 ($num) is not well-formed
+ValueError: bcpow(): Argument #2 ($exponent) is not well-formed
diff --git a/ext/bcmath/tests/bcpowmod_error.phpt b/ext/bcmath/tests/bcpowmod_error.phpt
index ff2862310cb2..9b9770a959d7 100644
--- a/ext/bcmath/tests/bcpowmod_error.phpt
+++ b/ext/bcmath/tests/bcpowmod_error.phpt
@@ -8,23 +8,23 @@ bcmath
try {
bcpowmod('a', '1', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcpowmod('1', 'a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcpowmod('1', '1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpowmod(): Argument #1 ($num) is not well-formed
-bcpowmod(): Argument #2 ($exponent) is not well-formed
-bcpowmod(): Argument #3 ($modulus) is not well-formed
+ValueError: bcpowmod(): Argument #1 ($num) is not well-formed
+ValueError: bcpowmod(): Argument #2 ($exponent) is not well-formed
+ValueError: bcpowmod(): Argument #3 ($modulus) is not well-formed
diff --git a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt
index 7814e2bd41d8..61b60ff60234 100644
--- a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt
+++ b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt
@@ -9,8 +9,8 @@ bcmath
try {
var_dump(bcpowmod('1', '-1', '2'));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0
+ValueError: bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0
diff --git a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt
index 8540a0d6df3c..833a55266e3e 100644
--- a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt
+++ b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt
@@ -9,8 +9,8 @@ bcmath
try {
var_dump(bcpowmod('1', '1', '0'));
} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/bcmath/tests/bcround_error.phpt b/ext/bcmath/tests/bcround_error.phpt
index 95579a4edf09..fe114cf8bba6 100644
--- a/ext/bcmath/tests/bcround_error.phpt
+++ b/ext/bcmath/tests/bcround_error.phpt
@@ -7,15 +7,15 @@ bcmath
try {
bcround('hoge');
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcround('0.00.1');
} catch (Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-bcround(): Argument #1 ($num) is not well-formed
-bcround(): Argument #1 ($num) is not well-formed
+ValueError: bcround(): Argument #1 ($num) is not well-formed
+ValueError: bcround(): Argument #1 ($num) is not well-formed
diff --git a/ext/bcmath/tests/bcround_precision_bounds.phpt b/ext/bcmath/tests/bcround_precision_bounds.phpt
index 4c4f910476a7..fcfb2d2c3248 100644
--- a/ext/bcmath/tests/bcround_precision_bounds.phpt
+++ b/ext/bcmath/tests/bcround_precision_bounds.phpt
@@ -9,20 +9,20 @@ bcmath
try {
bcround('1', PHP_INT_MAX);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
(new BcMath\Number('1'))->round(PHP_INT_MAX);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
(new BcMath\Number('1'))->round(2147483648); // INT_MAX + 1
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-bcround(): Argument #2 ($precision) must be between %i and %d
-BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
-BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
+ValueError: bcround(): Argument #2 ($precision) must be between %i and %d
+ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
+ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
diff --git a/ext/bcmath/tests/bcscale_variation001.phpt b/ext/bcmath/tests/bcscale_variation001.phpt
index 8d9d32e064b8..ce51029e4b68 100644
--- a/ext/bcmath/tests/bcscale_variation001.phpt
+++ b/ext/bcmath/tests/bcscale_variation001.phpt
@@ -6,13 +6,13 @@ bcmath
bcmath.scale=0
--FILE--
getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
5
-bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
+ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
diff --git a/ext/bcmath/tests/bcsqrt_error1.phpt b/ext/bcmath/tests/bcsqrt_error1.phpt
index 78923f4a9480..9d265d8c76c2 100644
--- a/ext/bcmath/tests/bcsqrt_error1.phpt
+++ b/ext/bcmath/tests/bcsqrt_error1.phpt
@@ -10,8 +10,8 @@ bcmath
try {
bcsqrt('-9');
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcsqrt(): Argument #1 ($num) must be greater than or equal to 0
+ValueError: bcsqrt(): Argument #1 ($num) must be greater than or equal to 0
diff --git a/ext/bcmath/tests/bcsqrt_error2.phpt b/ext/bcmath/tests/bcsqrt_error2.phpt
index 1ef934d3bcf1..0e49714db29d 100644
--- a/ext/bcmath/tests/bcsqrt_error2.phpt
+++ b/ext/bcmath/tests/bcsqrt_error2.phpt
@@ -8,9 +8,9 @@ bcmath
try {
bcsqrt('a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcsqrt(): Argument #1 ($num) is not well-formed
+ValueError: bcsqrt(): Argument #1 ($num) is not well-formed
diff --git a/ext/bcmath/tests/bcsub_error.phpt b/ext/bcmath/tests/bcsub_error.phpt
index 4e1abd3fa950..0e04cffafde6 100644
--- a/ext/bcmath/tests/bcsub_error.phpt
+++ b/ext/bcmath/tests/bcsub_error.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcsub('a', '1');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcsub('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcsub(): Argument #1 ($num1) is not well-formed
-bcsub(): Argument #2 ($num2) is not well-formed
+ValueError: bcsub(): Argument #1 ($num1) is not well-formed
+ValueError: bcsub(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt
index 16d058441a35..46aa59fdb265 100644
--- a/ext/bcmath/tests/bug60377.phpt
+++ b/ext/bcmath/tests/bug60377.phpt
@@ -10,10 +10,10 @@ if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
try {
$var48 = bcscale(634314234334311);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$var67 = bcsqrt(0);
$var414 = bcadd(0,-1,10);
?>
--EXPECT--
-bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
+ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
diff --git a/ext/bcmath/tests/bug72093.phpt b/ext/bcmath/tests/bug72093.phpt
index a424a59e0470..c88afacedea4 100644
--- a/ext/bcmath/tests/bug72093.phpt
+++ b/ext/bcmath/tests/bug72093.phpt
@@ -7,14 +7,14 @@ bcmath
try {
var_dump(bcpowmod(1, 0, 128, -200));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bcpowmod(1, 1.2, 1, 1));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
-bcpowmod(): Argument #2 ($exponent) cannot have a fractional part
+ValueError: bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
+ValueError: bcpowmod(): Argument #2 ($exponent) cannot have a fractional part
diff --git a/ext/bcmath/tests/bug75178.phpt b/ext/bcmath/tests/bug75178.phpt
index 940a3567de16..14d627bada03 100644
--- a/ext/bcmath/tests/bug75178.phpt
+++ b/ext/bcmath/tests/bug75178.phpt
@@ -7,14 +7,14 @@ bcmath
try {
var_dump(bcpowmod('4.1', '4', '3', 3));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bcpowmod('4', '4', '3.1', 3));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpowmod(): Argument #1 ($num) cannot have a fractional part
-bcpowmod(): Argument #3 ($modulus) cannot have a fractional part
+ValueError: bcpowmod(): Argument #1 ($num) cannot have a fractional part
+ValueError: bcpowmod(): Argument #3 ($modulus) cannot have a fractional part
diff --git a/ext/bcmath/tests/bug78878.phpt b/ext/bcmath/tests/bug78878.phpt
index 9d9d0db48cf4..1ba4376cd7dd 100644
--- a/ext/bcmath/tests/bug78878.phpt
+++ b/ext/bcmath/tests/bug78878.phpt
@@ -7,8 +7,8 @@ bcmath
try {
print bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcpowmod(): Argument #3 ($modulus) cannot have a fractional part
+ValueError: bcpowmod(): Argument #3 ($modulus) cannot have a fractional part
diff --git a/ext/bcmath/tests/bug80545.phpt b/ext/bcmath/tests/bug80545.phpt
index f1e256776d93..ca795e01d0dc 100644
--- a/ext/bcmath/tests/bug80545.phpt
+++ b/ext/bcmath/tests/bug80545.phpt
@@ -8,16 +8,16 @@ bcmath
try {
bcadd('a', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcadd('1', 'a');
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #2 ($num2) is not well-formed
\ No newline at end of file
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #2 ($num2) is not well-formed
diff --git a/ext/bcmath/tests/gh15968.phpt b/ext/bcmath/tests/gh15968.phpt
index aa91534e7738..ddf112412785 100644
--- a/ext/bcmath/tests/gh15968.phpt
+++ b/ext/bcmath/tests/gh15968.phpt
@@ -15,8 +15,8 @@ $b = new MyString();
try {
var_dump($a + $b);
} catch (Error $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Unsupported operand types: BcMath\Number + MyString
+TypeError: Unsupported operand types: BcMath\Number + MyString
diff --git a/ext/bcmath/tests/negative_scale.phpt b/ext/bcmath/tests/negative_scale.phpt
index 3b9377559098..ed3d726f6ec3 100644
--- a/ext/bcmath/tests/negative_scale.phpt
+++ b/ext/bcmath/tests/negative_scale.phpt
@@ -9,62 +9,62 @@ bcmath.scale=0
try {
bcadd('1','2',-1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcsub('1','2',-1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcmul('1','2',-1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcdiv('1','2',-1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcmod('1','2',-1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcpowmod('1', '2', '3', -9);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcpow('1', '2', -1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcsqrt('9', -1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bccomp('1', '2', -1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bcscale(-1);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bcadd(): Argument #3 ($scale) must be between 0 and 2147483647
-bcsub(): Argument #3 ($scale) must be between 0 and 2147483647
-bcmul(): Argument #3 ($scale) must be between 0 and 2147483647
-bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647
-bcmod(): Argument #3 ($scale) must be between 0 and 2147483647
-bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
-bcpow(): Argument #3 ($scale) must be between 0 and 2147483647
-bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647
-bccomp(): Argument #3 ($scale) must be between 0 and 2147483647
-bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
+ValueError: bcadd(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcsub(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcmul(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcmod(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
+ValueError: bcpow(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647
+ValueError: bccomp(): Argument #3 ($scale) must be between 0 and 2147483647
+ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
diff --git a/ext/bcmath/tests/number/construct_error.phpt b/ext/bcmath/tests/number/construct_error.phpt
index 0b49e871cea9..f2113f1c44a2 100644
--- a/ext/bcmath/tests/number/construct_error.phpt
+++ b/ext/bcmath/tests/number/construct_error.phpt
@@ -8,16 +8,16 @@ try {
$num = new BcMath\Number('1');
$num->__construct(5);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num = new BcMath\Number('a');
var_dump($num);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property BcMath\Number::$value
-BcMath\Number::__construct(): Argument #1 ($num) is not well-formed
+Error: Cannot modify readonly property BcMath\Number::$value
+ValueError: BcMath\Number::__construct(): Argument #1 ($num) is not well-formed
diff --git a/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt b/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt
index 7f64f3101139..f4935762383c 100644
--- a/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt
+++ b/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt
@@ -29,7 +29,7 @@ foreach ($methods as $method) {
try {
$num->$method($val);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
echo "\n";
@@ -38,11 +38,11 @@ foreach ($methods as $method) {
--EXPECTF--
========== add ==========
non number str:
-BcMath\Number::add(): Argument #1 ($num) is not well-formed
+ValueError: BcMath\Number::add(): Argument #1 ($num) is not well-formed
array:
-BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
@@ -52,11 +52,11 @@ Deprecated: BcMath\Number::add(): Passing null to parameter #1 ($num) of type Bc
========== sub ==========
non number str:
-BcMath\Number::sub(): Argument #1 ($num) is not well-formed
+ValueError: BcMath\Number::sub(): Argument #1 ($num) is not well-formed
array:
-BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
@@ -66,11 +66,11 @@ Deprecated: BcMath\Number::sub(): Passing null to parameter #1 ($num) of type Bc
========== mul ==========
non number str:
-BcMath\Number::mul(): Argument #1 ($num) is not well-formed
+ValueError: BcMath\Number::mul(): Argument #1 ($num) is not well-formed
array:
-BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
@@ -80,43 +80,43 @@ Deprecated: BcMath\Number::mul(): Passing null to parameter #1 ($num) of type Bc
========== div ==========
non number str:
-BcMath\Number::div(): Argument #1 ($num) is not well-formed
+ValueError: BcMath\Number::div(): Argument #1 ($num) is not well-formed
array:
-BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
-Division by zero
+DivisionByZeroError: Division by zero
null:
Deprecated: BcMath\Number::div(): Passing null to parameter #1 ($num) of type BcMath\Number|string|int is deprecated in %s
-Division by zero
+DivisionByZeroError: Division by zero
========== mod ==========
non number str:
-BcMath\Number::mod(): Argument #1 ($num) is not well-formed
+ValueError: BcMath\Number::mod(): Argument #1 ($num) is not well-formed
array:
-BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
-Modulo by zero
+DivisionByZeroError: Modulo by zero
null:
Deprecated: BcMath\Number::mod(): Passing null to parameter #1 ($num) of type BcMath\Number|string|int is deprecated in %s
-Modulo by zero
+DivisionByZeroError: Modulo by zero
========== pow ==========
non number str:
-BcMath\Number::pow(): Argument #1 ($exponent) is not well-formed
+ValueError: BcMath\Number::pow(): Argument #1 ($exponent) is not well-formed
array:
-BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
diff --git a/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt b/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt
index 35e789f9c103..bce9ecebdf99 100644
--- a/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt
+++ b/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt
@@ -27,7 +27,7 @@ foreach ($methods as $method) {
try {
$num->$method(1, $val);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
echo "\n";
@@ -36,54 +36,54 @@ foreach ($methods as $method) {
--EXPECTF--
========== add ==========
array:
-BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, array given
+TypeError: BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, array given
other object:
-BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, stdClass given
+TypeError: BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
========== sub ==========
array:
-BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, array given
+TypeError: BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, array given
other object:
-BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, stdClass given
+TypeError: BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
========== mul ==========
array:
-BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, array given
+TypeError: BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, array given
other object:
-BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, stdClass given
+TypeError: BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
========== div ==========
array:
-BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, array given
+TypeError: BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, array given
other object:
-BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, stdClass given
+TypeError: BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
========== mod ==========
array:
-BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, array given
+TypeError: BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, array given
other object:
-BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, stdClass given
+TypeError: BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
========== pow ==========
array:
-BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, array given
+TypeError: BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, array given
other object:
-BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, stdClass given
+TypeError: BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
diff --git a/ext/bcmath/tests/number/methods/compare_arg_error.phpt b/ext/bcmath/tests/number/methods/compare_arg_error.phpt
index bf714304d7fd..ff752d3d36e5 100644
--- a/ext/bcmath/tests/number/methods/compare_arg_error.phpt
+++ b/ext/bcmath/tests/number/methods/compare_arg_error.phpt
@@ -18,20 +18,20 @@ foreach ($args as [$val, $type]) {
try {
$num->compare($val);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
}
?>
--EXPECTF--
non number str:
-BcMath\Number::compare(): Argument #1 ($num) is not well-formed
+ValueError: BcMath\Number::compare(): Argument #1 ($num) is not well-formed
array:
-BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given
float:
diff --git a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt
index 6a7099b1c30e..565fd65bf136 100644
--- a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt
+++ b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt
@@ -21,21 +21,21 @@ foreach ($values as $value) {
try {
$num->pow($exponent);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
?>
--EXPECT--
0 ** -3: int
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: string
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: object
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -3: int
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: string
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: object
-Negative power of zero
+DivisionByZeroError: Negative power of zero
diff --git a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt
index 796769e1e6c4..923bd9968b61 100644
--- a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt
+++ b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt
@@ -20,7 +20,7 @@ foreach ($args as [$val, $type]) {
try {
$num->powmod($val, 1);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -32,18 +32,18 @@ foreach ($args as [$val, $type]) {
try {
$num->powmod(1, $val);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECTF--
========== check 1st arg ==========
non number str:
-BcMath\Number::powmod(): Argument #1 ($exponent) is not well-formed
+ValueError: BcMath\Number::powmod(): Argument #1 ($exponent) is not well-formed
array:
-BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
@@ -53,16 +53,16 @@ Deprecated: BcMath\Number::powmod(): Passing null to parameter #1 ($exponent) of
========== check 2nd arg ==========
non number str:
-BcMath\Number::powmod(): Argument #2 ($modulus) is not well-formed
+ValueError: BcMath\Number::powmod(): Argument #2 ($modulus) is not well-formed
array:
-BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, array given
+TypeError: BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, array given
other object:
-BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, stdClass given
+TypeError: BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, stdClass given
float:
Deprecated: Implicit conversion from float 0.1 to int loses precision in %s
-Modulo by zero
+DivisionByZeroError: Modulo by zero
null:
Deprecated: BcMath\Number::powmod(): Passing null to parameter #2 ($modulus) of type BcMath\Number|string|int is deprecated in %s
-Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/bcmath/tests/number/operators/calc_array.phpt b/ext/bcmath/tests/number/operators/calc_array.phpt
index 31acfb3ad118..b1322de040d0 100644
--- a/ext/bcmath/tests/number/operators/calc_array.phpt
+++ b/ext/bcmath/tests/number/operators/calc_array.phpt
@@ -10,43 +10,43 @@ $array = [1];
try {
$num + $array;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - $array;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * $array;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $array;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $array;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** $array;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: BcMath\Number + array
-Unsupported operand types: BcMath\Number - array
-Unsupported operand types: BcMath\Number * array
-Unsupported operand types: BcMath\Number / array
-Unsupported operand types: BcMath\Number % array
-Unsupported operand types: BcMath\Number ** array
+TypeError: Unsupported operand types: BcMath\Number + array
+TypeError: Unsupported operand types: BcMath\Number - array
+TypeError: Unsupported operand types: BcMath\Number * array
+TypeError: Unsupported operand types: BcMath\Number / array
+TypeError: Unsupported operand types: BcMath\Number % array
+TypeError: Unsupported operand types: BcMath\Number ** array
diff --git a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt
index d9fe499d921d..05720638f7eb 100644
--- a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt
+++ b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt
@@ -9,43 +9,43 @@ $num = new BcMath\Number(100);
try {
$num + 'a';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - 'a';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * 'a';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / 'a';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % 'a';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** 'a';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Right string operand cannot be converted to BcMath\Number
-Right string operand cannot be converted to BcMath\Number
-Right string operand cannot be converted to BcMath\Number
-Right string operand cannot be converted to BcMath\Number
-Right string operand cannot be converted to BcMath\Number
-Right string operand cannot be converted to BcMath\Number
+ValueError: Right string operand cannot be converted to BcMath\Number
+ValueError: Right string operand cannot be converted to BcMath\Number
+ValueError: Right string operand cannot be converted to BcMath\Number
+ValueError: Right string operand cannot be converted to BcMath\Number
+ValueError: Right string operand cannot be converted to BcMath\Number
+ValueError: Right string operand cannot be converted to BcMath\Number
diff --git a/ext/bcmath/tests/number/operators/calc_null.phpt b/ext/bcmath/tests/number/operators/calc_null.phpt
index a5745dc5e762..301ec7c70dce 100644
--- a/ext/bcmath/tests/number/operators/calc_null.phpt
+++ b/ext/bcmath/tests/number/operators/calc_null.phpt
@@ -9,43 +9,43 @@ $num = new BcMath\Number(100);
try {
$num + null;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - null;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * null;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / null;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % null;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** null;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: BcMath\Number + null
-Unsupported operand types: BcMath\Number - null
-Unsupported operand types: BcMath\Number * null
-Unsupported operand types: BcMath\Number / null
-Unsupported operand types: BcMath\Number % null
-Unsupported operand types: BcMath\Number ** null
+TypeError: Unsupported operand types: BcMath\Number + null
+TypeError: Unsupported operand types: BcMath\Number - null
+TypeError: Unsupported operand types: BcMath\Number * null
+TypeError: Unsupported operand types: BcMath\Number / null
+TypeError: Unsupported operand types: BcMath\Number % null
+TypeError: Unsupported operand types: BcMath\Number ** null
diff --git a/ext/bcmath/tests/number/operators/calc_other_class.phpt b/ext/bcmath/tests/number/operators/calc_other_class.phpt
index 5c6a11747def..2c43340feac7 100644
--- a/ext/bcmath/tests/number/operators/calc_other_class.phpt
+++ b/ext/bcmath/tests/number/operators/calc_other_class.phpt
@@ -10,43 +10,43 @@ $other = new stdClass();
try {
$num + $other;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - $other;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * $other;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $other;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $other;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** $other;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: BcMath\Number + stdClass
-Unsupported operand types: BcMath\Number - stdClass
-Unsupported operand types: BcMath\Number * stdClass
-Unsupported operand types: BcMath\Number / stdClass
-Unsupported operand types: BcMath\Number % stdClass
-Unsupported operand types: BcMath\Number ** stdClass
+TypeError: Unsupported operand types: BcMath\Number + stdClass
+TypeError: Unsupported operand types: BcMath\Number - stdClass
+TypeError: Unsupported operand types: BcMath\Number * stdClass
+TypeError: Unsupported operand types: BcMath\Number / stdClass
+TypeError: Unsupported operand types: BcMath\Number % stdClass
+TypeError: Unsupported operand types: BcMath\Number ** stdClass
diff --git a/ext/bcmath/tests/number/operators/calc_undef.phpt b/ext/bcmath/tests/number/operators/calc_undef.phpt
index f7b188a8d211..fdde7613cdd0 100644
--- a/ext/bcmath/tests/number/operators/calc_undef.phpt
+++ b/ext/bcmath/tests/number/operators/calc_undef.phpt
@@ -9,54 +9,54 @@ $num = new BcMath\Number(100);
try {
$num + $undef;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - $undef;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * $undef;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $undef;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $undef;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** $undef;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $undef in %s
-Unsupported operand types: BcMath\Number + null
+TypeError: Unsupported operand types: BcMath\Number + null
Warning: Undefined variable $undef in %s
-Unsupported operand types: BcMath\Number - null
+TypeError: Unsupported operand types: BcMath\Number - null
Warning: Undefined variable $undef in %s
-Unsupported operand types: BcMath\Number * null
+TypeError: Unsupported operand types: BcMath\Number * null
Warning: Undefined variable $undef in %s
-Unsupported operand types: BcMath\Number / null
+TypeError: Unsupported operand types: BcMath\Number / null
Warning: Undefined variable $undef in %s
-Unsupported operand types: BcMath\Number % null
+TypeError: Unsupported operand types: BcMath\Number % null
Warning: Undefined variable $undef in %s
-Unsupported operand types: BcMath\Number ** null
+TypeError: Unsupported operand types: BcMath\Number ** null
diff --git a/ext/bcmath/tests/number/operators/div_by_zero.phpt b/ext/bcmath/tests/number/operators/div_by_zero.phpt
index cadac7361a2f..684cc133fa28 100644
--- a/ext/bcmath/tests/number/operators/div_by_zero.phpt
+++ b/ext/bcmath/tests/number/operators/div_by_zero.phpt
@@ -9,19 +9,19 @@ $num = new BcMath\Number(100);
try {
$num / 0;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / '0';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / (new BcMath\Number(0));
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$zero = new BcMath\Number(0);
@@ -29,25 +29,25 @@ $zero = new BcMath\Number(0);
try {
100 / $zero;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
'100' / $zero;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $zero;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Division by zero
-Division by zero
-Division by zero
-Division by zero
-Division by zero
-Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
+DivisionByZeroError: Division by zero
diff --git a/ext/bcmath/tests/number/operators/mod_by_zero.phpt b/ext/bcmath/tests/number/operators/mod_by_zero.phpt
index 9c1e08f6a4dc..56382255e0f7 100644
--- a/ext/bcmath/tests/number/operators/mod_by_zero.phpt
+++ b/ext/bcmath/tests/number/operators/mod_by_zero.phpt
@@ -9,19 +9,19 @@ $num = new BcMath\Number(100);
try {
$num % 0;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % '0';
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % (new BcMath\Number(0));
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$zero = new BcMath\Number(0);
@@ -29,25 +29,25 @@ $zero = new BcMath\Number(0);
try {
100 % $zero;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
'100' % $zero;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $zero;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Modulo by zero
-Modulo by zero
-Modulo by zero
-Modulo by zero
-Modulo by zero
-Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt
index ff03626fca60..aa0f32de49f8 100644
--- a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt
+++ b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt
@@ -21,21 +21,21 @@ foreach ($values as $value) {
try {
$num ** $exponent;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
?>
--EXPECT--
0 ** -3: int
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: string
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: object
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -3: int
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: string
-Negative power of zero
+DivisionByZeroError: Negative power of zero
0 ** -2: object
-Negative power of zero
+DivisionByZeroError: Negative power of zero
diff --git a/ext/bcmath/tests/number/properties_unknown.phpt b/ext/bcmath/tests/number/properties_unknown.phpt
index cd1c13eb0c74..9a9bc6c461a9 100644
--- a/ext/bcmath/tests/number/properties_unknown.phpt
+++ b/ext/bcmath/tests/number/properties_unknown.phpt
@@ -12,7 +12,7 @@ var_dump($num->foo);
try {
$num->foo = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($num->foo);
@@ -20,7 +20,7 @@ var_dump($num->foo);
try {
$num->bar = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(isset($num->foo));
@@ -28,9 +28,9 @@ var_dump(isset($num->foo));
--EXPECTF--
Warning: Undefined property: BcMath\Number::$foo in %s
NULL
-Cannot create dynamic property BcMath\Number::$foo
+Error: Cannot create dynamic property BcMath\Number::$foo
Warning: Undefined property: BcMath\Number::$foo in %s
NULL
-Cannot create dynamic property BcMath\Number::$bar
+Error: Cannot create dynamic property BcMath\Number::$bar
bool(false)
diff --git a/ext/bcmath/tests/number/properties_unset.phpt b/ext/bcmath/tests/number/properties_unset.phpt
index ce21350240bb..052764b10d38 100644
--- a/ext/bcmath/tests/number/properties_unset.phpt
+++ b/ext/bcmath/tests/number/properties_unset.phpt
@@ -9,15 +9,15 @@ $num = new BcMath\Number(1);
try {
unset($num->value);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($num->scale);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot unset readonly property BcMath\Number::$value
-Cannot unset readonly property BcMath\Number::$scale
+Error: Cannot unset readonly property BcMath\Number::$value
+Error: Cannot unset readonly property BcMath\Number::$scale
diff --git a/ext/bcmath/tests/number/properties_write_error.phpt b/ext/bcmath/tests/number/properties_write_error.phpt
index 03683c4c0926..673bddd8c6ac 100644
--- a/ext/bcmath/tests/number/properties_write_error.phpt
+++ b/ext/bcmath/tests/number/properties_write_error.phpt
@@ -9,15 +9,15 @@ $num = new BcMath\Number(1);
try {
$num->value = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num->scale = 1;
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot modify readonly property BcMath\Number::$value
-Cannot modify readonly property BcMath\Number::$scale
+Error: Cannot modify readonly property BcMath\Number::$value
+Error: Cannot modify readonly property BcMath\Number::$scale
diff --git a/ext/bcmath/tests/number/unserialize_error.phpt b/ext/bcmath/tests/number/unserialize_error.phpt
index 030ba1232d06..f0338f62fb64 100644
--- a/ext/bcmath/tests/number/unserialize_error.phpt
+++ b/ext/bcmath/tests/number/unserialize_error.phpt
@@ -8,7 +8,7 @@ try {
$num = new BcMath\Number(1);
$num->__unserialize(['value' => '5']);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -23,14 +23,14 @@ foreach ($cases as $case) {
try {
unserialize($case);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--EXPECT--
-Cannot modify readonly property BcMath\Number::$value
+Error: Cannot modify readonly property BcMath\Number::$value
-Invalid serialization data for BcMath\Number object
-Invalid serialization data for BcMath\Number object
-Invalid serialization data for BcMath\Number object
-Invalid serialization data for BcMath\Number object
+Exception: Invalid serialization data for BcMath\Number object
+Exception: Invalid serialization data for BcMath\Number object
+Exception: Invalid serialization data for BcMath\Number object
+Exception: Invalid serialization data for BcMath\Number object
diff --git a/ext/bcmath/tests/sec_embedded_null_truncation.phpt b/ext/bcmath/tests/sec_embedded_null_truncation.phpt
index 157810ecbb3a..8606abd6aa3a 100644
--- a/ext/bcmath/tests/sec_embedded_null_truncation.phpt
+++ b/ext/bcmath/tests/sec_embedded_null_truncation.phpt
@@ -27,33 +27,33 @@ foreach ($cases as $s) {
$fn($s);
echo "FAIL: accepted\n";
} catch (\ValueError $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
?>
--EXPECT--
-bcadd(): Argument #1 ($num1) is not well-formed
-bcsub(): Argument #1 ($num1) is not well-formed
-bcmul(): Argument #1 ($num1) is not well-formed
-bcdiv(): Argument #1 ($num1) is not well-formed
-bcmod(): Argument #1 ($num1) is not well-formed
-bcpow(): Argument #1 ($num) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
-bcsqrt(): Argument #1 ($num) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
-bcsub(): Argument #1 ($num1) is not well-formed
-bcmul(): Argument #1 ($num1) is not well-formed
-bcdiv(): Argument #1 ($num1) is not well-formed
-bcmod(): Argument #1 ($num1) is not well-formed
-bcpow(): Argument #1 ($num) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
-bcsqrt(): Argument #1 ($num) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
-bcsub(): Argument #1 ($num1) is not well-formed
-bcmul(): Argument #1 ($num1) is not well-formed
-bcdiv(): Argument #1 ($num1) is not well-formed
-bcmod(): Argument #1 ($num1) is not well-formed
-bcpow(): Argument #1 ($num) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
-bcsqrt(): Argument #1 ($num) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcsub(): Argument #1 ($num1) is not well-formed
+ValueError: bcmul(): Argument #1 ($num1) is not well-formed
+ValueError: bcdiv(): Argument #1 ($num1) is not well-formed
+ValueError: bcmod(): Argument #1 ($num1) is not well-formed
+ValueError: bcpow(): Argument #1 ($num) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bcsqrt(): Argument #1 ($num) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcsub(): Argument #1 ($num1) is not well-formed
+ValueError: bcmul(): Argument #1 ($num1) is not well-formed
+ValueError: bcdiv(): Argument #1 ($num1) is not well-formed
+ValueError: bcmod(): Argument #1 ($num1) is not well-formed
+ValueError: bcpow(): Argument #1 ($num) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bcsqrt(): Argument #1 ($num) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcsub(): Argument #1 ($num1) is not well-formed
+ValueError: bcmul(): Argument #1 ($num1) is not well-formed
+ValueError: bcdiv(): Argument #1 ($num1) is not well-formed
+ValueError: bcmod(): Argument #1 ($num1) is not well-formed
+ValueError: bcpow(): Argument #1 ($num) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bcsqrt(): Argument #1 ($num) is not well-formed
diff --git a/ext/bcmath/tests/str2num_formatting.phpt b/ext/bcmath/tests/str2num_formatting.phpt
index 4b77381de868..61c81b17ca6b 100644
--- a/ext/bcmath/tests/str2num_formatting.phpt
+++ b/ext/bcmath/tests/str2num_formatting.phpt
@@ -19,37 +19,37 @@ echo "\n";
try {
echo bcadd(" 0", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bcadd("1e1", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bcadd("1,1", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bcadd("Hello", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bcadd("1 1", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bcadd("1.a", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "\n";
@@ -65,31 +65,31 @@ echo "\n";
try {
echo bccomp(" 0", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bccomp("1e1", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bccomp("1,1", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bccomp("Hello", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
echo bccomp("1 1", "2");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -100,12 +100,12 @@ try {
2
2
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
-bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
+ValueError: bcadd(): Argument #1 ($num1) is not well-formed
-1
-1
@@ -113,8 +113,8 @@ bcadd(): Argument #1 ($num1) is not well-formed
-1
-1
-bccomp(): Argument #1 ($num1) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
-bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
+ValueError: bccomp(): Argument #1 ($num1) is not well-formed
diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt
index 6323a224c3ac..31a8c1ea8bce 100644
--- a/ext/bz2/tests/001.phpt
+++ b/ext/bz2/tests/001.phpt
@@ -8,31 +8,31 @@ bz2
try {
var_dump(bzopen("", "r"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("", "w"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("no_such_file", ""));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("no_such_file", "x"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bzopen("no_such_file", "rw"));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bzopen("no_such_file", "r"));
@@ -42,11 +42,11 @@ var_dump(bzopen($fp, "r"));
?>
--EXPECTF--
-bzopen(): Argument #1 ($file) must not be empty
-bzopen(): Argument #1 ($file) must not be empty
-bzopen(): Argument #2 ($mode) must be either "r" or "w"
-bzopen(): Argument #2 ($mode) must be either "r" or "w"
-bzopen(): Argument #2 ($mode) must be either "r" or "w"
+ValueError: bzopen(): Argument #1 ($file) must not be empty
+ValueError: bzopen(): Argument #1 ($file) must not be empty
+ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
+ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
+ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
Warning: bzopen(): Failed to open stream: No such file or directory in %s on line %d
bool(false)
diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt
index 7210f90a4d92..105fa0b4f57e 100644
--- a/ext/bz2/tests/002.phpt
+++ b/ext/bz2/tests/002.phpt
@@ -31,14 +31,14 @@ $fp = fopen("bz_open_002.txt", "br");
try {
var_dump(bzopen($fp, "r"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$fp = fopen("bz_open_002.txt", "br");
try {
var_dump(bzopen($fp, "w"));
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$fp = fopen("bz_open_002.txt", "r");
@@ -91,10 +91,10 @@ resource(%d) of type (stream)
resource(%d) of type (stream)
Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d
-bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
+TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d
-bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
+TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
bool(false)
diff --git a/ext/bz2/tests/003-mb.phpt b/ext/bz2/tests/003-mb.phpt
index 3189b473a4ac..805cc150e1ed 100644
--- a/ext/bz2/tests/003-mb.phpt
+++ b/ext/bz2/tests/003-mb.phpt
@@ -11,7 +11,7 @@ var_dump(bzread($fd, 0));
try {
var_dump(bzread($fd, -10));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bzread($fd, 1));
@@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000));
?>
--EXPECT--
string(0) ""
-bzread(): Argument #2 ($length) must be greater than or equal to 0
+ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
diff --git a/ext/bz2/tests/003.phpt b/ext/bz2/tests/003.phpt
index 4b6ee820dd56..f737422a074c 100644
--- a/ext/bz2/tests/003.phpt
+++ b/ext/bz2/tests/003.phpt
@@ -11,7 +11,7 @@ var_dump(bzread($fd, 0));
try {
var_dump(bzread($fd, -10));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bzread($fd, 1));
@@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000));
?>
--EXPECT--
string(0) ""
-bzread(): Argument #2 ($length) must be greater than or equal to 0
+ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
diff --git a/ext/bz2/tests/004.phpt b/ext/bz2/tests/004.phpt
index 240cef37a17a..910aa067f6b4 100644
--- a/ext/bz2/tests/004.phpt
+++ b/ext/bz2/tests/004.phpt
@@ -39,22 +39,22 @@ bzclose($fd2);
try {
var_dump(bzread($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerror($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrstr($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrno($fd2));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
@@ -112,8 +112,8 @@ array(2) {
}
string(10) "DATA_ERROR"
int(-4)
-bzread(): Argument #1 ($bz) must be an open stream resource
-bzerror(): Argument #1 ($bz) must be an open stream resource
-bzerrstr(): Argument #1 ($bz) must be an open stream resource
-bzerrno(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzread(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzerror(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzerrstr(): Argument #1 ($bz) must be an open stream resource
+TypeError: bzerrno(): Argument #1 ($bz) must be an open stream resource
Done
diff --git a/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt b/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
index a9fd3a211869..03b8e09c6547 100644
--- a/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
+++ b/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
@@ -8,20 +8,20 @@ $f = fopen(__FILE__, 'r');
try {
var_dump(bzerrno($f));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrstr($f));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerror($f));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-bzerrno(): Argument #1 ($bz) must be a bz2 stream
-bzerrstr(): Argument #1 ($bz) must be a bz2 stream
-bzerror(): Argument #1 ($bz) must be a bz2 stream
+TypeError: bzerrno(): Argument #1 ($bz) must be a bz2 stream
+TypeError: bzerrstr(): Argument #1 ($bz) must be a bz2 stream
+TypeError: bzerror(): Argument #1 ($bz) must be a bz2 stream
diff --git a/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt b/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
index b76515a178d9..6f47c2fa237c 100644
--- a/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
+++ b/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
@@ -8,16 +8,16 @@ bz2
try {
bzopen("file\0", "w");
} catch (TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
bzopen("file\0", "r");
} catch (TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-bzopen(): Argument #1 ($file) must not contain null bytes
-bzopen(): Argument #1 ($file) must not contain null bytes
+TypeError: bzopen(): Argument #1 ($file) must not contain null bytes
+TypeError: bzopen(): Argument #1 ($file) must not contain null bytes
diff --git a/ext/calendar/tests/bug80185.phpt b/ext/calendar/tests/bug80185.phpt
index d52f9696a173..44b9df86ac0c 100644
--- a/ext/calendar/tests/bug80185.phpt
+++ b/ext/calendar/tests/bug80185.phpt
@@ -13,10 +13,10 @@ var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588)));
try {
var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589)));
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
int(2170713600)
int(9223372036854720000)
-jday must be between 2440588 and 106751993607888
+ValueError: jday must be between 2440588 and 106751993607888
diff --git a/ext/calendar/tests/cal_days_in_month_error1.phpt b/ext/calendar/tests/cal_days_in_month_error1.phpt
index e110c13cc2a7..dcf7db51ec0b 100644
--- a/ext/calendar/tests/cal_days_in_month_error1.phpt
+++ b/ext/calendar/tests/cal_days_in_month_error1.phpt
@@ -9,14 +9,14 @@ calendar
try {
cal_days_in_month(-1, 4, 2017);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try{
cal_days_in_month(CAL_GREGORIAN,20, 2009);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
-Invalid date
+ValueError: cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
+ValueError: Invalid date
diff --git a/ext/calendar/tests/cal_from_jd_error1.phpt b/ext/calendar/tests/cal_from_jd_error1.phpt
index 3b4e11b8350d..80731b867647 100644
--- a/ext/calendar/tests/cal_from_jd_error1.phpt
+++ b/ext/calendar/tests/cal_from_jd_error1.phpt
@@ -9,8 +9,8 @@ calendar
try {
cal_from_jd(1748326, -1);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
+ValueError: cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
diff --git a/ext/calendar/tests/cal_info.phpt b/ext/calendar/tests/cal_info.phpt
index 18884917e534..1990c1ccbd6d 100644
--- a/ext/calendar/tests/cal_info.phpt
+++ b/ext/calendar/tests/cal_info.phpt
@@ -11,7 +11,7 @@ calendar
try {
cal_info(99999);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
@@ -216,4 +216,4 @@ Array
[calname] => Julian
[calsymbol] => CAL_JULIAN
)
-cal_info(): Argument #1 ($calendar) must be a valid calendar ID
+ValueError: cal_info(): Argument #1 ($calendar) must be a valid calendar ID
diff --git a/ext/calendar/tests/cal_to_jd_error1.phpt b/ext/calendar/tests/cal_to_jd_error1.phpt
index 1cef36af69fe..18ab699de1d7 100644
--- a/ext/calendar/tests/cal_to_jd_error1.phpt
+++ b/ext/calendar/tests/cal_to_jd_error1.phpt
@@ -9,8 +9,8 @@ calendar
try {
cal_to_jd(-1, 8, 26, 74);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
+ValueError: cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
diff --git a/ext/calendar/tests/easter_date_64bit.phpt b/ext/calendar/tests/easter_date_64bit.phpt
index 3939b7e4a4d4..f6d97ba9f20f 100644
--- a/ext/calendar/tests/easter_date_64bit.phpt
+++ b/ext/calendar/tests/easter_date_64bit.phpt
@@ -20,14 +20,14 @@ echo date("Y-m-d", easter_date(2047))."\n";
try {
easter_date(1492);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-2000-04-23
-2001-04-15
-2002-03-31
-2045-04-09
-2046-03-25
-2047-04-14
-easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive)
+2000-04-23
+2001-04-15
+2002-03-31
+2045-04-09
+2046-03-25
+2047-04-14
+ValueError: easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive)
diff --git a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
index 2c7afbdfa2d9..c2177673ffee 100644
--- a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
+++ b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
@@ -14,8 +14,8 @@ putenv('TZ=UTC');
try {
easter_date(293274701009);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive)
+ValueError: easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive)
diff --git a/ext/calendar/tests/gh16228.phpt b/ext/calendar/tests/gh16228.phpt
index 9ce80688195b..0699152566fe 100644
--- a/ext/calendar/tests/gh16228.phpt
+++ b/ext/calendar/tests/gh16228.phpt
@@ -7,20 +7,20 @@ calendar
try {
easter_days(PHP_INT_MAX, 0);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
easter_days(-1, 0);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
easter_date(PHP_INT_MAX, 0);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-easter_days(): Argument #1 ($year) must be between 1 and %d
-easter_days(): Argument #1 ($year) must be between 1 and %d
-easter_date(): Argument #1 ($year) must be between 1 and %d
+ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d
+ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d
+ValueError: easter_date(): Argument #1 ($year) must be between 1 and %d
diff --git a/ext/calendar/tests/gh16231.phpt b/ext/calendar/tests/gh16231.phpt
index 89b09dd3f63a..d003f38b1f06 100644
--- a/ext/calendar/tests/gh16231.phpt
+++ b/ext/calendar/tests/gh16231.phpt
@@ -7,15 +7,15 @@ calendar
try {
jdtounix(PHP_INT_MIN);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
jdtounix(240587);
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-jday must be between 2440588 and %d
-jday must be between 2440588 and %d
+ValueError: jday must be between 2440588 and %d
+ValueError: jday must be between 2440588 and %d
diff --git a/ext/calendar/tests/gh16234_2_64.phpt b/ext/calendar/tests/gh16234_2_64.phpt
index 7da254609650..166e67a0efaf 100644
--- a/ext/calendar/tests/gh16234_2_64.phpt
+++ b/ext/calendar/tests/gh16234_2_64.phpt
@@ -13,9 +13,8 @@ if (PHP_INT_SIZE == 4) {
try {
jewishtojd(10, 6, PHP_INT_MIN);
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-jewishtojd(): Argument #3 ($year) must be between %i and %d
-
+ValueError: jewishtojd(): Argument #3 ($year) must be between %i and %d
diff --git a/ext/calendar/tests/gh19371.phpt b/ext/calendar/tests/gh19371.phpt
index 1d807a983886..b2b4837851cb 100644
--- a/ext/calendar/tests/gh19371.phpt
+++ b/ext/calendar/tests/gh19371.phpt
@@ -10,52 +10,52 @@ calendar
try {
echo cal_days_in_month(CAL_GREGORIAN, 12, PHP_INT_MAX);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_days_in_month(CAL_GREGORIAN, PHP_INT_MIN, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_days_in_month(CAL_GREGORIAN, PHP_INT_MAX, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, PHP_INT_MIN, 1, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, PHP_INT_MAX, 1, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, 1, PHP_INT_MIN, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, 1, PHP_INT_MAX, 1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo cal_to_jd(CAL_GREGORIAN, 1, 1, PHP_INT_MAX);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-cal_days_in_month(): Argument #3 ($year) must be less than 2147483646
-cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
-cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
-cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
-cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
-cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
-cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
-cal_to_jd(): Argument #4 ($year) must be less than 2147483646
+ValueError: cal_days_in_month(): Argument #3 ($year) must be less than 2147483646
+ValueError: cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646
+ValueError: cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
+ValueError: cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647
+ValueError: cal_to_jd(): Argument #4 ($year) must be less than 2147483646
diff --git a/ext/calendar/tests/jdtojewish.phpt b/ext/calendar/tests/jdtojewish.phpt
index 6b1c2e3f7756..ba40a2056da5 100644
--- a/ext/calendar/tests/jdtojewish.phpt
+++ b/ext/calendar/tests/jdtojewish.phpt
@@ -23,7 +23,7 @@ echo jdtojewish(gregoriantojd(1,1,9998)) . "\n";
try {
jdtojewish(gregoriantojd(1,1,9998),true);
} catch (ValueError $ex) {
- echo "{$ex->getMessage()}\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -42,4 +42,4 @@ string(%d) "2/22/5763
2/30/5763
3/16/5765
3/8/13758
-Year out of range (0-9999)
+ValueError: Year out of range (0-9999)
diff --git a/ext/calendar/tests/jdtojewish_hebrew.phpt b/ext/calendar/tests/jdtojewish_hebrew.phpt
index ceb53c219e71..3909162e1bf4 100644
--- a/ext/calendar/tests/jdtojewish_hebrew.phpt
+++ b/ext/calendar/tests/jdtojewish_hebrew.phpt
@@ -46,4 +46,3 @@ e020f1e9e5ef20e4e0
e020faeee5e620e4e0
e020e0e120e4e0
e020e0ece5ec20e4e0
-
diff --git a/ext/calendar/tests/jdtounix_error1.phpt b/ext/calendar/tests/jdtounix_error1.phpt
index 0032e376db3c..adad98947dcd 100644
--- a/ext/calendar/tests/jdtounix_error1.phpt
+++ b/ext/calendar/tests/jdtounix_error1.phpt
@@ -11,8 +11,8 @@ calendar
try {
jdtounix(2440579);
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-jday must be between 2440588 and %d
+ValueError: jday must be between 2440588 and %d
diff --git a/ext/calendar/tests/unixtojd_error1.phpt b/ext/calendar/tests/unixtojd_error1.phpt
index 171d400b99e7..a17a5b291a05 100644
--- a/ext/calendar/tests/unixtojd_error1.phpt
+++ b/ext/calendar/tests/unixtojd_error1.phpt
@@ -13,12 +13,12 @@ putenv('TZ=UTC');
try {
unixtojd(-1);
} catch (ValueError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
var_dump(unixtojd(null)) . PHP_EOL;
var_dump(unixtojd(time())) . PHP_EOL;
?>
--EXPECTF--
-unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0
+ValueError: unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0
int(%d)
int(%d)
diff --git a/ext/curl/tests/bug48207.phpt b/ext/curl/tests/bug48207.phpt
index 086f949ff63d..e312a09b6198 100644
--- a/ext/curl/tests/bug48207.phpt
+++ b/ext/curl/tests/bug48207.phpt
@@ -39,7 +39,7 @@ $ch = curl_init($url);
try {
curl_setopt($ch, CURLOPT_FILE, $fp);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
curl_exec($ch);
@@ -47,6 +47,6 @@ is_file($tempfile) and @unlink($tempfile);
isset($tempname) and is_file($tempname) and @unlink($tempname);
?>
--EXPECT--
-curl_setopt(): The provided file handle must be writable
+ValueError: curl_setopt(): The provided file handle must be writable
Hello World!
Hello World!
diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt
index b8733c5066b8..b869745e1add 100644
--- a/ext/curl/tests/bug68089.phpt
+++ b/ext/curl/tests/bug68089.phpt
@@ -10,11 +10,11 @@ $ch = curl_init();
try {
curl_setopt($ch, CURLOPT_URL, $url);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
Done
--EXPECT--
-curl_setopt(): cURL option must not contain any null bytes
+ValueError: curl_setopt(): cURL option must not contain any null bytes
Done
diff --git a/ext/curl/tests/bug73147.phpt b/ext/curl/tests/bug73147.phpt
index b0f01e64e31d..4561785cb999 100644
--- a/ext/curl/tests/bug73147.phpt
+++ b/ext/curl/tests/bug73147.phpt
@@ -8,8 +8,8 @@ $poc = 'a:1:{i:0;O:8:"CURLFile":1:{s:4:"name";R:1;}}';
try {
var_dump(unserialize($poc));
} catch(Exception $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Unserialization of 'CURLFile' is not allowed
+Exception: Unserialization of 'CURLFile' is not allowed
diff --git a/ext/curl/tests/bug80121.phpt b/ext/curl/tests/bug80121.phpt
index a7bf6385367d..d750856f06ec 100644
--- a/ext/curl/tests/bug80121.phpt
+++ b/ext/curl/tests/bug80121.phpt
@@ -8,21 +8,21 @@ curl
try {
new CurlHandle;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new CurlMultiHandle;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new CurlShareHandle;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot directly construct CurlHandle, use curl_init() instead
-Cannot directly construct CurlMultiHandle, use curl_multi_init() instead
-Cannot directly construct CurlShareHandle, use curl_share_init() instead
+Error: Cannot directly construct CurlHandle, use curl_init() instead
+Error: Cannot directly construct CurlMultiHandle, use curl_multi_init() instead
+Error: Cannot directly construct CurlShareHandle, use curl_share_init() instead
diff --git a/ext/curl/tests/curl_file_upload.phpt b/ext/curl/tests/curl_file_upload.phpt
index 8b85190ff41e..732d626c664b 100644
--- a/ext/curl/tests/curl_file_upload.phpt
+++ b/ext/curl/tests/curl_file_upload.phpt
@@ -45,7 +45,7 @@ var_dump(curl_exec($ch));
try {
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt');
@@ -72,7 +72,7 @@ string(%d) "%s/curl_testdata1.txt"
string(%d) "curl_testdata1.txt|text/plain|6"
string(%d) "foo.txt"
string(%d) "foo.txt|application/octet-stream|6"
-curl_setopt(): Disabling safe uploads is no longer supported
+ValueError: curl_setopt(): Disabling safe uploads is no longer supported
string(0) ""
string(0) ""
string(%d) "array(1) {
diff --git a/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt b/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt
index 4a90b0a3c52e..be671e73ef3c 100644
--- a/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt
+++ b/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt
@@ -143,4 +143,3 @@ bool(true)
bool(true)
bool(true)
bool(true)
-
diff --git a/ext/curl/tests/curl_multi_errno_strerror_001.phpt b/ext/curl/tests/curl_multi_errno_strerror_001.phpt
index 80ec44c4c247..9bb9b168f828 100644
--- a/ext/curl/tests/curl_multi_errno_strerror_001.phpt
+++ b/ext/curl/tests/curl_multi_errno_strerror_001.phpt
@@ -13,7 +13,7 @@ echo curl_multi_strerror($errno) . PHP_EOL;
try {
curl_multi_setopt($mh, -1, -1);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
$errno = curl_multi_errno($mh);
@@ -23,6 +23,6 @@ echo curl_multi_strerror($errno) . PHP_EOL;
--EXPECT--
0
No error
-curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
+ValueError: curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
6
Unknown option
diff --git a/ext/curl/tests/curl_multi_setopt_basic001.phpt b/ext/curl/tests/curl_multi_setopt_basic001.phpt
index 71d176c0a109..479ae758e0c2 100644
--- a/ext/curl/tests/curl_multi_setopt_basic001.phpt
+++ b/ext/curl/tests/curl_multi_setopt_basic001.phpt
@@ -11,10 +11,10 @@ var_dump(curl_multi_setopt($mh, CURLMOPT_PIPELINING, 0));
try {
curl_multi_setopt($mh, -1, 0);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
-curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
+ValueError: curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option
diff --git a/ext/curl/tests/curl_persistent_share_003.phpt b/ext/curl/tests/curl_persistent_share_003.phpt
index 60a30de4d464..0ed7dfd22e97 100644
--- a/ext/curl/tests/curl_persistent_share_003.phpt
+++ b/ext/curl/tests/curl_persistent_share_003.phpt
@@ -8,9 +8,9 @@ curl
try {
$sh = curl_share_init_persistent([CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_CONNECT, 30]);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-curl_share_init_persistent(): Argument #1 ($share_options) must contain only CURL_LOCK_DATA_* constants
+ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must contain only CURL_LOCK_DATA_* constants
diff --git a/ext/curl/tests/curl_persistent_share_004.phpt b/ext/curl/tests/curl_persistent_share_004.phpt
index fe0e7ec2cf0e..ffd58abc0172 100644
--- a/ext/curl/tests/curl_persistent_share_004.phpt
+++ b/ext/curl/tests/curl_persistent_share_004.phpt
@@ -8,9 +8,9 @@ curl
try {
$sh = curl_share_init_persistent([CURL_LOCK_DATA_COOKIE]);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-curl_share_init_persistent(): Argument #1 ($share_options) must not contain CURL_LOCK_DATA_COOKIE because sharing cookies across PHP requests is unsafe
+ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must not contain CURL_LOCK_DATA_COOKIE because sharing cookies across PHP requests is unsafe
diff --git a/ext/curl/tests/curl_persistent_share_005.phpt b/ext/curl/tests/curl_persistent_share_005.phpt
index 8737ba6c39a4..7b7403a76f3b 100644
--- a/ext/curl/tests/curl_persistent_share_005.phpt
+++ b/ext/curl/tests/curl_persistent_share_005.phpt
@@ -10,9 +10,9 @@ $sh = curl_share_init_persistent([CURL_LOCK_DATA_DNS]);
try {
curl_share_setopt($sh, CURLOPT_SHARE, CURL_LOCK_DATA_CONNECT);
} catch (\TypeError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, CurlSharePersistentHandle given
+TypeError: curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, CurlSharePersistentHandle given
diff --git a/ext/curl/tests/curl_persistent_share_006.phpt b/ext/curl/tests/curl_persistent_share_006.phpt
index ffca764757fb..8921ddba8903 100644
--- a/ext/curl/tests/curl_persistent_share_006.phpt
+++ b/ext/curl/tests/curl_persistent_share_006.phpt
@@ -8,9 +8,9 @@ curl
try {
$sh = curl_share_init_persistent([]);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-curl_share_init_persistent(): Argument #1 ($share_options) must not be empty
+ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must not be empty
diff --git a/ext/curl/tests/curl_seekfunction_error.phpt b/ext/curl/tests/curl_seekfunction_error.phpt
index 134e8115dc5f..31808d78a3c8 100644
--- a/ext/curl/tests/curl_seekfunction_error.phpt
+++ b/ext/curl/tests/curl_seekfunction_error.phpt
@@ -31,14 +31,14 @@ echo "Returning a non-int:\n";
try {
run_upload($host, fn($ch, $offset, $origin) => 'not an int');
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nReturning an out-of-range int:\n";
try {
run_upload($host, fn($ch, $offset, $origin) => 42);
} catch (\ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nThrowing from the callback:\n";
@@ -47,7 +47,7 @@ try {
throw new \RuntimeException('boom from seek');
});
} catch (\RuntimeException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\nSetting the callback to null:\n";
@@ -57,21 +57,21 @@ echo "\nSetting a non-callable scalar:\n";
try {
curl_setopt(curl_init(), CURLOPT_SEEKFUNCTION, 42);
} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Returning a non-int:
-The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK
+TypeError: The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK
Returning an out-of-range int:
-The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK
+ValueError: The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK
Throwing from the callback:
-boom from seek
+RuntimeException: boom from seek
Setting the callback to null:
bool(true)
Setting a non-callable scalar:
-curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_SEEKFUNCTION, no array or string given
+TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_SEEKFUNCTION, no array or string given
diff --git a/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt
index 7193642dcab0..b523acc1648b 100644
--- a/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt
+++ b/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt
@@ -87,14 +87,14 @@ try {
var_dump(curl_setopt($ch, CURLINFO_HEADER_OUT, true));
}
catch (\ValueError $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$chCopy = curl_copy_handle($ch);
try {
var_dump(curl_setopt($chCopy, CURLINFO_HEADER_OUT, true));
}
catch (\ValueError $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(curl_setopt($chCopy, CURLOPT_DEBUGFUNCTION, null));
var_dump(curl_setopt($chCopy, CURLINFO_HEADER_OUT, true));
@@ -138,7 +138,7 @@ try {
var_dump($result = curl_exec($ch));
}
catch (\RuntimeException $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(curl_getinfo($ch, CURLINFO_HEADER_OUT));
@@ -183,8 +183,8 @@ bool(true)
bool(true)
bool(true)
bool(true)
-string(87) "CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set"
-string(87) "CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set"
+ValueError: CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set
+ValueError: CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set
bool(true)
bool(true)
@@ -216,7 +216,7 @@ Accept: */*
===Test CURLOPT_DEBUGFUNCTION can throw within callback===
bool(true)
-string(41) "This should get caught after verbose=true"
+RuntimeException: This should get caught after verbose=true
string(%d) "GET /get.inc?test=file HTTP/%s
Host: %s:%d
Accept: */*
diff --git a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt
index 39a1d1e3caa8..8f507a6c8fd9 100644
--- a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt
+++ b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt
@@ -73,7 +73,7 @@ curl_setopt($ch, CURLOPT_PREREQFUNCTION, function() use ($port) {
try {
curl_exec($ch);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "\nTesting with invalid type\n";
@@ -83,7 +83,7 @@ curl_setopt($ch, CURLOPT_PREREQFUNCTION, function() use ($port) {
try {
curl_exec($ch);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "\nTesting with invalid value\n";
@@ -93,21 +93,21 @@ curl_setopt($ch, CURLOPT_PREREQFUNCTION, function() use ($port) {
try {
curl_exec($ch);
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "\nTesting with invalid option value\n";
try {
curl_setopt($ch, CURLOPT_PREREQFUNCTION, 42);
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "\nTesting with invalid option callback\n";
try {
curl_setopt($ch, CURLOPT_PREREQFUNCTION, 'function_does_not_exist');
} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "\nTesting with null as the callback\n";
@@ -161,19 +161,19 @@ string(0) ""
int(0)
Testing with no return type
-The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
+TypeError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
Testing with invalid type
-The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
+TypeError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
Testing with invalid value
-The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
+ValueError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
Testing with invalid option value
-curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given
+TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given
Testing with invalid option callback
-curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name
+TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name
Testing with null as the callback
bool(true)
diff --git a/ext/curl/tests/curl_setopt_basic003.phpt b/ext/curl/tests/curl_setopt_basic003.phpt
index 008162c9b474..daeac6b07c14 100644
--- a/ext/curl/tests/curl_setopt_basic003.phpt
+++ b/ext/curl/tests/curl_setopt_basic003.phpt
@@ -20,7 +20,7 @@ $ch = curl_init();
try {
curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
$curl_content = curl_exec($ch);
@@ -42,6 +42,6 @@ var_dump( $curl_content );
?>
--EXPECT--
*** curl_setopt() call with CURLOPT_HTTPHEADER
-curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value
+TypeError: curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value
bool(false)
bool(true)
diff --git a/ext/curl/tests/curl_setopt_error.phpt b/ext/curl/tests/curl_setopt_error.phpt
index 0979cec0816d..0495d2e56dab 100644
--- a/ext/curl/tests/curl_setopt_error.phpt
+++ b/ext/curl/tests/curl_setopt_error.phpt
@@ -13,24 +13,24 @@ $ch = curl_init();
try {
curl_setopt($ch, '', false);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
curl_setopt($ch, -10, 0);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
curl_setopt($ch, 1000, 0);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
*** curl_setopt() call with incorrect parameters
-curl_setopt(): Argument #2 ($option) must be of type int, string given
-curl_setopt(): Argument #2 ($option) is not a valid cURL option
-curl_setopt(): Argument #2 ($option) is not a valid cURL option
+TypeError: curl_setopt(): Argument #2 ($option) must be of type int, string given
+ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option
+ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option
diff --git a/ext/curl/tests/curl_setopt_error_nul_byte.phpt b/ext/curl/tests/curl_setopt_error_nul_byte.phpt
index 23be973b82c2..8eae484b51d9 100644
--- a/ext/curl/tests/curl_setopt_error_nul_byte.phpt
+++ b/ext/curl/tests/curl_setopt_error_nul_byte.phpt
@@ -24,29 +24,20 @@ foreach ($list_options as $option) {
try {
curl_setopt($ch, constant($option), ["Something: foo\0bar"]);
} catch (ValueError $exception) {
- echo $option . ": " . $exception->getMessage() . "\n\n";
+ echo $option, ': ', $exception::class, ': ', $exception->getMessage(), "\n";
}
}
$ch = null;
?>
--EXPECT--
-CURLOPT_HTTP200ALIASES: curl_setopt(): cURL option CURLOPT_HTTP200ALIASES must not contain any null bytes
-
-CURLOPT_HTTPHEADER: curl_setopt(): cURL option CURLOPT_HTTPHEADER must not contain any null bytes
-
-CURLOPT_POSTQUOTE: curl_setopt(): cURL option CURLOPT_POSTQUOTE must not contain any null bytes
-
-CURLOPT_PREQUOTE: curl_setopt(): cURL option CURLOPT_PREQUOTE must not contain any null bytes
-
-CURLOPT_QUOTE: curl_setopt(): cURL option CURLOPT_QUOTE must not contain any null bytes
-
-CURLOPT_TELNETOPTIONS: curl_setopt(): cURL option CURLOPT_TELNETOPTIONS must not contain any null bytes
-
-CURLOPT_MAIL_RCPT: curl_setopt(): cURL option CURLOPT_MAIL_RCPT must not contain any null bytes
-
-CURLOPT_RESOLVE: curl_setopt(): cURL option CURLOPT_RESOLVE must not contain any null bytes
-
-CURLOPT_PROXYHEADER: curl_setopt(): cURL option CURLOPT_PROXYHEADER must not contain any null bytes
-
-CURLOPT_CONNECT_TO: curl_setopt(): cURL option CURLOPT_CONNECT_TO must not contain any null bytes
+CURLOPT_HTTP200ALIASES: ValueError: curl_setopt(): cURL option CURLOPT_HTTP200ALIASES must not contain any null bytes
+CURLOPT_HTTPHEADER: ValueError: curl_setopt(): cURL option CURLOPT_HTTPHEADER must not contain any null bytes
+CURLOPT_POSTQUOTE: ValueError: curl_setopt(): cURL option CURLOPT_POSTQUOTE must not contain any null bytes
+CURLOPT_PREQUOTE: ValueError: curl_setopt(): cURL option CURLOPT_PREQUOTE must not contain any null bytes
+CURLOPT_QUOTE: ValueError: curl_setopt(): cURL option CURLOPT_QUOTE must not contain any null bytes
+CURLOPT_TELNETOPTIONS: ValueError: curl_setopt(): cURL option CURLOPT_TELNETOPTIONS must not contain any null bytes
+CURLOPT_MAIL_RCPT: ValueError: curl_setopt(): cURL option CURLOPT_MAIL_RCPT must not contain any null bytes
+CURLOPT_RESOLVE: ValueError: curl_setopt(): cURL option CURLOPT_RESOLVE must not contain any null bytes
+CURLOPT_PROXYHEADER: ValueError: curl_setopt(): cURL option CURLOPT_PROXYHEADER must not contain any null bytes
+CURLOPT_CONNECT_TO: ValueError: curl_setopt(): cURL option CURLOPT_CONNECT_TO must not contain any null bytes
diff --git a/ext/curl/tests/curl_share_errno_strerror_001.phpt b/ext/curl/tests/curl_share_errno_strerror_001.phpt
index 6a69a3a48773..835b8a8afef2 100644
--- a/ext/curl/tests/curl_share_errno_strerror_001.phpt
+++ b/ext/curl/tests/curl_share_errno_strerror_001.phpt
@@ -13,7 +13,7 @@ echo curl_share_strerror($errno) . PHP_EOL;
try {
curl_share_setopt($sh, -1, -1);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$errno = curl_share_errno($sh);
@@ -23,6 +23,6 @@ echo curl_share_strerror($errno) . PHP_EOL;
--EXPECT--
0
No error
-curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
+ValueError: curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
1
Unknown share option
diff --git a/ext/curl/tests/curl_share_setopt_basic001.phpt b/ext/curl/tests/curl_share_setopt_basic001.phpt
index d9a9c1788e88..11a5e4d1dc87 100644
--- a/ext/curl/tests/curl_share_setopt_basic001.phpt
+++ b/ext/curl/tests/curl_share_setopt_basic001.phpt
@@ -12,11 +12,11 @@ var_dump(curl_share_setopt($sh, CURLSHOPT_UNSHARE, CURL_LOCK_DATA_DNS));
try {
curl_share_setopt($sh, -1, 0);
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
bool(true)
-curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
+ValueError: curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
diff --git a/ext/curl/tests/gh15547.phpt b/ext/curl/tests/gh15547.phpt
index 489fdd0b999a..6b2b0521a1c6 100644
--- a/ext/curl/tests/gh15547.phpt
+++ b/ext/curl/tests/gh15547.phpt
@@ -10,20 +10,20 @@ $mh = curl_multi_init();
try {
curl_multi_select($mh, -2500000);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
curl_multi_close($mh);
$mh = curl_multi_init();
try {
curl_multi_select($mh, 2500000);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
curl_multi_close($mh);
$mh = curl_multi_init();
var_dump(curl_multi_select($mh, 1000000));
?>
--EXPECTF--
-curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
-curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
+ValueError: curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
+ValueError: curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
int(0)
diff --git a/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt b/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt
index f8b1e1cffe43..a5ae7e11b29f 100644
--- a/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt
+++ b/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt
@@ -10,13 +10,13 @@ var_dump(MyDatePeriod::createFromISO8601String("R4/2012-07-01T00:00:00Z/P7D"));
try {
MyDatePeriod::createFromISO8601String("R4/2012-07-01T00:/P7D");
} catch (DateMalformedPeriodStringException $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDatePeriod::createFromISO8601String("R4/2012-07-01T00:00:00Z");
} catch (DateMalformedPeriodStringException $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -65,5 +65,5 @@ object(MyDatePeriod)#1 (7) {
["include_end_date"]=>
bool(false)
}
-Unknown or bad format (R4/2012-07-01T00:/P7D)
-DatePeriod::createFromISO8601String(): ISO interval must contain an interval, "R4/2012-07-01T00:00:00Z" given
+DateMalformedPeriodStringException: Unknown or bad format (R4/2012-07-01T00:/P7D)
+DateMalformedPeriodStringException: DatePeriod::createFromISO8601String(): ISO interval must contain an interval, "R4/2012-07-01T00:00:00Z" given
diff --git a/ext/date/tests/DatePeriod_wrong_constructor.phpt b/ext/date/tests/DatePeriod_wrong_constructor.phpt
index 45f99bdb7270..eaf326f842ef 100644
--- a/ext/date/tests/DatePeriod_wrong_constructor.phpt
+++ b/ext/date/tests/DatePeriod_wrong_constructor.phpt
@@ -11,8 +11,8 @@ date.timezone=UTC
try {
new DatePeriod();
} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
-DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments
+TypeError: DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments
diff --git a/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt b/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt
index 31c6868d67fb..8e7a57fefe03 100644
--- a/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt
+++ b/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt
@@ -5,16 +5,16 @@ DatePeriod: Test wrong recurrence parameter on __construct
try {
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 0);
} catch (Exception $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), -1);
} catch (Exception $exception) {
- echo $exception->getMessage(), "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECTF--
-DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
-DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
+DateMalformedPeriodStringException: DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
+DateMalformedPeriodStringException: DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
diff --git a/ext/date/tests/bug-gh11416.phpt b/ext/date/tests/bug-gh11416.phpt
index 546867924cb4..ab8452d5897f 100644
--- a/ext/date/tests/bug-gh11416.phpt
+++ b/ext/date/tests/bug-gh11416.phpt
@@ -11,14 +11,14 @@ $date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor();
try {
new DatePeriod($date, new DateInterval('P1D'), 2);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor();
try {
new DatePeriod($now, new DateInterval('P1D'), $date);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor();
@@ -27,25 +27,25 @@ $dateinterval = (new ReflectionClass(DateInterval::class))->newInstanceWithoutCo
try {
$dateperiod->__unserialize(['start' => $date]);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$dateperiod->__unserialize(['start' => $now, 'end' => $date]);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$dateperiod->__unserialize(['start' => $now, 'end' => $now, 'current' => $date]);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$dateperiod->__unserialize(['start' => $now, 'end' => $now, 'current' => $now, 'interval' => $dateinterval]);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -55,7 +55,7 @@ try {
]);
echo "DatePeriod::__unserialize: SUCCESS\n";
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "OK\n";
?>
diff --git a/ext/date/tests/bug-gh15582.phpt b/ext/date/tests/bug-gh15582.phpt
index ab03e190e4bc..2dd6ec59b8f2 100644
--- a/ext/date/tests/bug-gh15582.phpt
+++ b/ext/date/tests/bug-gh15582.phpt
@@ -14,7 +14,7 @@ $fusion = $mdtz;
try {
date_create("2005-07-14 22:30:41", $fusion);
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/date/tests/bug-gh8471.phpt b/ext/date/tests/bug-gh8471.phpt
index 2f6656849f6c..0c1c69418692 100644
--- a/ext/date/tests/bug-gh8471.phpt
+++ b/ext/date/tests/bug-gh8471.phpt
@@ -8,7 +8,7 @@ $mutable = $reflection->newInstanceWithoutConstructor();
try {
$immutable = \DateTimeImmutable::createFromMutable($mutable);
} catch (Throwable $t) {
- echo $t->getMessage(), "\n";
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
@@ -18,7 +18,7 @@ $mutable = $reflection->newInstanceWithoutConstructor();
try {
$immutable = \DateTimeImmutable::createFromInterface($mutable);
} catch (Throwable $t) {
- echo $t->getMessage(), "\n";
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
@@ -28,7 +28,7 @@ $immutable = $reflection->newInstanceWithoutConstructor();
try {
$mutable = \DateTime::createFromImmutable($immutable);
} catch (Throwable $t) {
- echo $t->getMessage(), "\n";
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
@@ -38,13 +38,13 @@ $immutable = $reflection->newInstanceWithoutConstructor();
try {
$mutable = \DateTime::createFromInterface($immutable);
} catch (Throwable $t) {
- echo $t->getMessage(), "\n";
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
?>
--EXPECTF--
-Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor
-Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor
-Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor
-Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor
+DateObjectError: Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor
+DateObjectError: Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor
+DateObjectError: Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor
+DateObjectError: Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor
diff --git a/ext/date/tests/bug51819.phpt b/ext/date/tests/bug51819.phpt
index a5f21abf859e..21db1e774542 100644
--- a/ext/date/tests/bug51819.phpt
+++ b/ext/date/tests/bug51819.phpt
@@ -23,7 +23,7 @@ foreach ($aTz as $sTz) {
try {
$oDateTime = new DateTime($sDate);
} catch (Exception $oException) {
- var_dump($oException->getMessage());
+ echo $oException::class, ': ', $oException->getMessage(), "\n";
print_r(DateTime::getLastErrors());
}
}
diff --git a/ext/date/tests/bug54283.phpt b/ext/date/tests/bug54283.phpt
index 6acf6e5c8806..c6c303a4d0cc 100644
--- a/ext/date/tests/bug54283.phpt
+++ b/ext/date/tests/bug54283.phpt
@@ -6,7 +6,7 @@ Bug #54283 (new DatePeriod(NULL) causes crash)
try {
var_dump(new DatePeriod(NULL));
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -14,4 +14,4 @@ try {
Deprecated: DatePeriod::__construct(): Passing null to parameter #1 ($start) of type string is deprecated in %s on line %d
Deprecated: Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated, use DatePeriod::createFromISO8601String() instead in %s on line %d
-string(24) "Unknown or bad format ()"
+DateMalformedPeriodStringException: Unknown or bad format ()
diff --git a/ext/date/tests/bug62500.phpt b/ext/date/tests/bug62500.phpt
index e3a133fb63f5..39ea74cf86c9 100644
--- a/ext/date/tests/bug62500.phpt
+++ b/ext/date/tests/bug62500.phpt
@@ -17,7 +17,7 @@ class Crasher extends DateInterval {
try {
$c = new Crasher('blah');
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -26,4 +26,4 @@ int(3)
Warning: Undefined property: Crasher::$2 in %s on line %d
NULL
-string(28) "Unknown or bad format (blah)"
+DateMalformedIntervalStringException: Unknown or bad format (blah)
diff --git a/ext/date/tests/bug71826.phpt b/ext/date/tests/bug71826.phpt
index 1a4d8ff49f7e..42b0cbf346d3 100644
--- a/ext/date/tests/bug71826.phpt
+++ b/ext/date/tests/bug71826.phpt
@@ -29,4 +29,3 @@ int(28)
c(Asia/Tokyo): 2015-4-1 <--> 2015-4-29
int(0)
int(28)
-
diff --git a/ext/date/tests/bug72963.phpt b/ext/date/tests/bug72963.phpt
index 0fd01808a844..53327f367003 100644
--- a/ext/date/tests/bug72963.phpt
+++ b/ext/date/tests/bug72963.phpt
@@ -16,19 +16,19 @@ foreach ($strings as $string) {
try {
$d1 = DateTime::createFromFormat('!m/d/Y', $string);
} catch (ValueError $v) {
- echo $v->getMessage(), "\n";
+ echo $v::class, ': ', $v->getMessage(), "\n";
}
try {
$d2 = DateTimeImmutable::createFromFormat('!m/d/Y', $string);
} catch (ValueError $v) {
- echo $v->getMessage(), "\n";
+ echo $v::class, ': ', $v->getMessage(), "\n";
}
try {
$d3 = date_parse_from_format('m/d/Y', $string);
} catch (ValueError $v) {
- echo $v->getMessage(), "\n";
+ echo $v::class, ': ', $v->getMessage(), "\n";
}
var_dump($d1, $d2, $d3);
@@ -84,9 +84,9 @@ array(12) {
Covering string: 8/8/2016\0asf
-DateTime::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes
-DateTimeImmutable::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes
-date_parse_from_format(): Argument #2 ($datetime) must not contain any null bytes
+ValueError: DateTime::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes
+ValueError: DateTimeImmutable::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes
+ValueError: date_parse_from_format(): Argument #2 ($datetime) must not contain any null bytes
NULL
NULL
NULL
diff --git a/ext/date/tests/bug77097.phpt b/ext/date/tests/bug77097.phpt
index 080982d68169..c92fc5d01725 100644
--- a/ext/date/tests/bug77097.phpt
+++ b/ext/date/tests/bug77097.phpt
@@ -30,4 +30,3 @@ float(0.781751)
int(0)
int(0)
float(0.781751)
-
diff --git a/ext/date/tests/bug78139.phpt b/ext/date/tests/bug78139.phpt
index 47e5536cbaad..bd5d07066e5f 100644
--- a/ext/date/tests/bug78139.phpt
+++ b/ext/date/tests/bug78139.phpt
@@ -70,4 +70,3 @@ Parsing 'UTC xx':
Warning: timezone_open(): Unknown or bad timezone (UTC xx) in %sbug78139.php on line %d
bool(false)
DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (UTC xx)
-
diff --git a/ext/date/tests/createFromTimestamp.phpt b/ext/date/tests/createFromTimestamp.phpt
index f31aeae11854..cf6c753110b8 100644
--- a/ext/date/tests/createFromTimestamp.phpt
+++ b/ext/date/tests/createFromTimestamp.phpt
@@ -32,14 +32,14 @@ foreach ($timestamps as $ts) {
try {
var_dump(DateTime::createFromTimestamp($ts));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo 'DateTimeImmutable::createFromTimestamp(' . var_export($ts, true) . '): ';
try {
var_dump(DateTimeImmutable::createFromTimestamp($ts));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -47,14 +47,14 @@ echo 'MyDateTime::createFromTimestamp(' . var_export(0, true) . '): ';
try {
var_dump(MyDateTime::createFromTimestamp(0));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo 'MyDateTimeImmutable::createFromTimestamp(' . var_export(0, true) . '): ';
try {
var_dump(MyDateTimeImmutable::createFromTimestamp(0));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/ext/date/tests/date_interval_set_state_error1.phpt b/ext/date/tests/date_interval_set_state_error1.phpt
index ee68de8db466..4bb71320997f 100644
--- a/ext/date/tests/date_interval_set_state_error1.phpt
+++ b/ext/date/tests/date_interval_set_state_error1.phpt
@@ -14,7 +14,7 @@ try {
]
);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($interval);
@@ -43,7 +43,7 @@ object(DateInterval)#%d (%d) {
["from_string"]=>
bool(false)
}
-Unknown or bad format (wrong) at position 0 (w) while unserializing: The timezone could not be found in the database
+Error: Unknown or bad format (wrong) at position 0 (w) while unserializing: The timezone could not be found in the database
object(DateInterval)#%d (%d) {
["y"]=>
int(1)
diff --git a/ext/date/tests/date_period_exclude_start_and_include_end.phpt b/ext/date/tests/date_period_exclude_start_and_include_end.phpt
index 6238f6707351..bcfd89eb5c18 100644
--- a/ext/date/tests/date_period_exclude_start_and_include_end.phpt
+++ b/ext/date/tests/date_period_exclude_start_and_include_end.phpt
@@ -16,4 +16,3 @@ foreach ($dp as $day) {
2010-06-08
2010-06-09
2010-06-10
-
diff --git a/ext/date/tests/date_period_unset_property.phpt b/ext/date/tests/date_period_unset_property.phpt
index 7948d61d268d..ced092c768bc 100644
--- a/ext/date/tests/date_period_unset_property.phpt
+++ b/ext/date/tests/date_period_unset_property.phpt
@@ -14,58 +14,58 @@ unset($period->prop);
try {
$period->prop;
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->start);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->current);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->end);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->interval);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->recurrences);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->include_start_date);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($period->include_end_date);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Typed property MyDatePeriod::$prop must not be accessed before initialization
-Cannot unset MyDatePeriod::$start
-Cannot unset MyDatePeriod::$current
-Cannot unset MyDatePeriod::$end
-Cannot unset MyDatePeriod::$interval
-Cannot unset MyDatePeriod::$recurrences
-Cannot unset MyDatePeriod::$include_start_date
-Cannot unset MyDatePeriod::$include_end_date
+Error: Typed property MyDatePeriod::$prop must not be accessed before initialization
+Error: Cannot unset MyDatePeriod::$start
+Error: Cannot unset MyDatePeriod::$current
+Error: Cannot unset MyDatePeriod::$end
+Error: Cannot unset MyDatePeriod::$interval
+Error: Cannot unset MyDatePeriod::$recurrences
+Error: Cannot unset MyDatePeriod::$include_start_date
+Error: Cannot unset MyDatePeriod::$include_end_date
diff --git a/ext/date/tests/date_sunrise_and_sunset_error.phpt b/ext/date/tests/date_sunrise_and_sunset_error.phpt
index 01212992d8fb..0e756f505497 100644
--- a/ext/date/tests/date_sunrise_and_sunset_error.phpt
+++ b/ext/date/tests/date_sunrise_and_sunset_error.phpt
@@ -6,19 +6,19 @@ Test error condition of date_sunrise() and date_sunset()
try {
date_sunrise(time(), 3);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
date_sunset(time(), 4);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
-date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
+ValueError: date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
-date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
+ValueError: date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
diff --git a/ext/date/tests/getSetMicroseconds.phpt b/ext/date/tests/getSetMicroseconds.phpt
index debb5459633a..8f4aa864756c 100644
--- a/ext/date/tests/getSetMicroseconds.phpt
+++ b/ext/date/tests/getSetMicroseconds.phpt
@@ -37,7 +37,7 @@ foreach ($microsecondList as $microsecond) {
try {
var_dump($dt->setMicrosecond($microsecond));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo 'DateTime::getMicrosecond(): ' . var_export($dt->getMicrosecond(), true) . "\n";
@@ -45,7 +45,7 @@ foreach ($microsecondList as $microsecond) {
try {
var_dump($dti->setMicrosecond($microsecond));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo 'DateTimeImmutable::getMicrosecond(): ' . var_export($dti->getMicrosecond(), true) . "\n";
@@ -53,7 +53,7 @@ foreach ($microsecondList as $microsecond) {
try {
var_dump($myDt->setMicrosecond($microsecond));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo 'MyDateTime::getMicrosecond(): ' . var_export($myDt->getMicrosecond(), true) . "\n";
@@ -61,7 +61,7 @@ foreach ($microsecondList as $microsecond) {
try {
var_dump($myDti->setMicrosecond($microsecond));
} catch (Throwable $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo 'MyDateTimeImmutable::getMicrosecond(): ' . var_export($myDti->getMicrosecond(), true) . "\n";
}
diff --git a/ext/date/tests/gh14732.phpt b/ext/date/tests/gh14732.phpt
index 19b5f3b481f4..39f3116379e9 100644
--- a/ext/date/tests/gh14732.phpt
+++ b/ext/date/tests/gh14732.phpt
@@ -5,31 +5,31 @@ GH-14732 (date_sun_info() fails for non-finite values)
try {
date_sun_info(1, NAN, 1);
} catch (ValueError $ex) {
- echo $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
date_sun_info(1, -INF, 1);
} catch (ValueError $ex) {
- echo $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
date_sun_info(1, 1, NAN);
} catch (ValueError $ex) {
- echo $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
date_sun_info(1, 1, INF);
} catch (ValueError $ex) {
- echo $ex->getMessage(), "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
var_dump(date_sunset(1, SUNFUNCS_RET_STRING, NAN, 1));
var_dump(date_sunrise(1, SUNFUNCS_RET_STRING, 1, NAN));
?>
--EXPECTF--
-date_sun_info(): Argument #2 ($latitude) must be finite
-date_sun_info(): Argument #2 ($latitude) must be finite
-date_sun_info(): Argument #3 ($longitude) must be finite
-date_sun_info(): Argument #3 ($longitude) must be finite
+ValueError: date_sun_info(): Argument #2 ($latitude) must be finite
+ValueError: date_sun_info(): Argument #2 ($latitude) must be finite
+ValueError: date_sun_info(): Argument #3 ($longitude) must be finite
+ValueError: date_sun_info(): Argument #3 ($longitude) must be finite
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated since 8.4, as date_sunrise() and date_sunset() were deprecated in 8.1 in %s on line %d
diff --git a/ext/date/tests/gh20936.phpt b/ext/date/tests/gh20936.phpt
index e6a525dd4583..10ad79a9d25d 100644
--- a/ext/date/tests/gh20936.phpt
+++ b/ext/date/tests/gh20936.phpt
@@ -7,7 +7,7 @@ $interval = new DateInterval('P2D');
try {
DatePeriod::__set_state(['start' => null, 'end' => $end, 'current' => null, 'interval' => $interval, 'recurrences' => 2, 'include_start_date' => false, 'include_end_date' => true]);
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/date/tests/instantiate_uninstantiable_classes.phpt b/ext/date/tests/instantiate_uninstantiable_classes.phpt
index 634ed635b2d2..b14be57ec404 100644
--- a/ext/date/tests/instantiate_uninstantiable_classes.phpt
+++ b/ext/date/tests/instantiate_uninstantiable_classes.phpt
@@ -18,65 +18,65 @@ abstract class MyDateTimeImmutable extends DateTimeImmutable {
try {
MyDatePeriod::createFromISO8601String('R5');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTime::createFromFormat('Y-m-d', '2025-01-01');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTime::createFromImmutable(new DateTimeImmutable());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTime::createFromInterface(new DateTimeImmutable());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTime::createFromTimestamp(0);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTimeImmutable::createFromFormat('Y-m-d', '2025-01-01');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTimeImmutable::createFromMutable(new DateTime());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTimeImmutable::createFromInterface(new DateTime());
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
MyDateTimeImmutable::createFromTimestamp(0);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot instantiate abstract class MyDatePeriod
-Cannot instantiate abstract class MyDateTime
-Cannot instantiate abstract class MyDateTime
-Cannot instantiate abstract class MyDateTime
-Cannot instantiate abstract class MyDateTime
-Cannot instantiate abstract class MyDateTimeImmutable
-Cannot instantiate abstract class MyDateTimeImmutable
-Cannot instantiate abstract class MyDateTimeImmutable
-Cannot instantiate abstract class MyDateTimeImmutable
+Error: Cannot instantiate abstract class MyDatePeriod
+Error: Cannot instantiate abstract class MyDateTime
+Error: Cannot instantiate abstract class MyDateTime
+Error: Cannot instantiate abstract class MyDateTime
+Error: Cannot instantiate abstract class MyDateTime
+Error: Cannot instantiate abstract class MyDateTimeImmutable
+Error: Cannot instantiate abstract class MyDateTimeImmutable
+Error: Cannot instantiate abstract class MyDateTimeImmutable
+Error: Cannot instantiate abstract class MyDateTimeImmutable
diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt
index 4b5cda104ef6..efa5f353ba38 100644
--- a/ext/date/tests/timezone_offset_get_error.phpt
+++ b/ext/date/tests/timezone_offset_get_error.phpt
@@ -14,22 +14,19 @@ $invalid_obj = new stdClass();
try {
var_dump( timezone_offset_get($invalid_obj, $date) );
} catch (Error $ex) {
- var_dump($ex->getMessage());
- echo "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$invalid_obj = 10;
try {
var_dump( timezone_offset_get($invalid_obj, $date) );
} catch (Error $ex) {
- var_dump($ex->getMessage());
- echo "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$invalid_obj = null;
try {
var_dump( timezone_offset_get($invalid_obj, $date) );
} catch (Error $ex) {
- var_dump($ex->getMessage());
- echo "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
echo "\n-- Testing timezone_offset_get() function with an invalid values for \$datetime argument --\n";
@@ -37,38 +34,30 @@ $invalid_obj = new stdClass();
try {
var_dump( timezone_offset_get($tz, $invalid_obj) );
} catch (Error $ex) {
- var_dump($ex->getMessage());
- echo "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$invalid_obj = 10;
try {
var_dump( timezone_offset_get($tz, $invalid_obj) );
} catch (Error $ex) {
- var_dump($ex->getMessage());
- echo "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$invalid_obj = null;
try {
var_dump( timezone_offset_get($tz, $invalid_obj) );
} catch (Error $ex) {
- var_dump($ex->getMessage());
- echo "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
*** Testing timezone_offset_get() : error conditions ***
-- Testing timezone_offset_get() function with an invalid values for $object argument --
-string(89) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, stdClass given"
-
-string(84) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, int given"
-
-string(85) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, null given"
-
+TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, stdClass given
+TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, int given
+TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, null given
-- Testing timezone_offset_get() function with an invalid values for $datetime argument --
-string(96) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, stdClass given"
-
-string(91) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, int given"
-
-string(92) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, null given"
+TypeError: timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, stdClass given
+TypeError: timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, int given
+TypeError: timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, null given
diff --git a/ext/date/tests/unserialize-test.phpt b/ext/date/tests/unserialize-test.phpt
index aaff75db6b77..bf3bd117c0cc 100644
--- a/ext/date/tests/unserialize-test.phpt
+++ b/ext/date/tests/unserialize-test.phpt
@@ -17,7 +17,7 @@ foreach ($files as $file) {
try {
$x = unserialize(substr($s, strpos($s, "|") + 1));
} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($x);
echo "\n\n";
diff --git a/ext/dba/tests/dba015.phpt b/ext/dba/tests/dba015.phpt
index a2fa60eb6028..b8979f962df4 100644
--- a/ext/dba/tests/dba015.phpt
+++ b/ext/dba/tests/dba015.phpt
@@ -48,7 +48,7 @@ var_dump($db_file1);
try {
dba_exists("key1", $db_file2);
} catch (Error $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Test 6 - query after closing 2nd object\n";
@@ -75,7 +75,7 @@ This is a test insert 2
Test 5 - close 2nd object
object(Dba\Connection)#%d (%d) {
}
-DBA connection has already been closed
+Error: DBA connection has already been closed
Test 6 - query after closing 2nd object
This is a test insert 1
This is a test insert 2
diff --git a/ext/dba/tests/dba_array_keys_errors.phpt b/ext/dba/tests/dba_array_keys_errors.phpt
index d80915c7c318..e9544c8d7176 100644
--- a/ext/dba/tests/dba_array_keys_errors.phpt
+++ b/ext/dba/tests/dba_array_keys_errors.phpt
@@ -17,12 +17,12 @@ $db = get_any_db($name);
try {
dba_insert([], "Content String 1", $db);
} catch (\Error $e) {
- echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
dba_insert(["a", "b", "c"], "Content String 2", $db);
} catch (\Error $e) {
- echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
/* Use an object */
@@ -30,12 +30,12 @@ $o = new stdClass();
try {
var_dump(dba_insert([$o, 'obj'], 'Test', $db));
} catch (\Error $e) {
- echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_insert(['group', $o], 'Test', $db));
} catch (\Error $e) {
- echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
dba_close($db);
diff --git a/ext/dba/tests/dba_fetch_legacy_signature.phpt b/ext/dba/tests/dba_fetch_legacy_signature.phpt
index 40933f4c76b1..be5f78dd0326 100644
--- a/ext/dba/tests/dba_fetch_legacy_signature.phpt
+++ b/ext/dba/tests/dba_fetch_legacy_signature.phpt
@@ -24,7 +24,7 @@ set_error_handler(function ($severity, $message, $file, $line) {
try {
dba_fetch("key1", 0, $db);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
dba_close($db);
@@ -41,4 +41,4 @@ Using handler: "%s"
Deprecated: Calling dba_fetch() with $dba at the 3rd parameter is deprecated in %s on line %d
This is a test insert
This is a test insert
-Calling dba_fetch() with $dba at the 3rd parameter is deprecated
+Exception: Calling dba_fetch() with $dba at the 3rd parameter is deprecated
diff --git a/ext/dba/tests/dba_flags_arg.phpt b/ext/dba/tests/dba_flags_arg.phpt
index 6a387b51822b..6815f3dec213 100644
--- a/ext/dba/tests/dba_flags_arg.phpt
+++ b/ext/dba/tests/dba_flags_arg.phpt
@@ -7,8 +7,8 @@ dba
try {
dba_open('irrelevant', 'c', 'handler', flags: -1);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-dba_open(): Argument #6 ($flags) must be greater than or equal to 0
+ValueError: dba_open(): Argument #6 ($flags) must be greater than or equal to 0
diff --git a/ext/dba/tests/gh19885.phpt b/ext/dba/tests/gh19885.phpt
index 987aea4f175a..e6358b3c59b0 100644
--- a/ext/dba/tests/gh19885.phpt
+++ b/ext/dba/tests/gh19885.phpt
@@ -16,20 +16,20 @@ $db =dba_open($db_file, "r", $handler);
try {
dba_fetch("1", $db, PHP_INT_MIN);
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
dba_fetch("1", $db, PHP_INT_MAX);
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
// negative skip needs to remain acceptable albeit corrected down the line
var_dump(dba_fetch("1", $db, -1000000));
?>
--EXPECTF--
-dba_fetch(): Argument #3 ($skip) must be between -%d and %d
-dba_fetch(): Argument #3 ($skip) must be between -%d and %d
+ValueError: dba_fetch(): Argument #3 ($skip) must be between -%d and %d
+ValueError: dba_fetch(): Argument #3 ($skip) must be between -%d and %d
Notice: dba_fetch(): Handler cdb accepts only skip values greater than or equal to zero, using skip=0 in %s on line %d
string(1) "1"
diff --git a/ext/dba/tests/value_errors_open.phpt b/ext/dba/tests/value_errors_open.phpt
index ee995fe5b8d6..b5472a23d695 100644
--- a/ext/dba/tests/value_errors_open.phpt
+++ b/ext/dba/tests/value_errors_open.phpt
@@ -21,45 +21,45 @@ var_dump(dba_open($db_file, 'n', 'bogus'));
try {
var_dump(dba_open('', 'nq'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, ''));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, 'nq', ''));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, 'q'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, 'nq'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, 'rdq'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, 'n-t'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_open($db_file, 'r', $handler, 0o644, -10));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo '=== Invalid arguments dba_popen() ===', \PHP_EOL;
@@ -68,45 +68,45 @@ var_dump(dba_popen($db_file, 'n', 'bogus'));
try {
var_dump(dba_popen('', 'nq'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, ''));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, 'nq', ''));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, 'q'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, 'nq'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, 'rdq'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, 'n-t'));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(dba_popen($db_file, 'r', $handler, 0o644, -10));
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--CLEAN--
@@ -121,23 +121,23 @@ object(Dba\Connection)#%d (%d) {
Warning: dba_open(): Handler "bogus" is not available in %s on line %d
bool(false)
-dba_open(): Argument #1 ($path) must not be empty
-dba_open(): Argument #2 ($mode) must not be empty
-dba_open(): Argument #3 ($handler) must not be empty
-dba_open(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n"
-dba_open(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t"
-dba_open(): Argument #2 ($mode) third character must be "t"
-dba_open(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock)
-dba_open(): Argument #5 ($map_size) must be greater than or equal to 0
+ValueError: dba_open(): Argument #1 ($path) must not be empty
+ValueError: dba_open(): Argument #2 ($mode) must not be empty
+ValueError: dba_open(): Argument #3 ($handler) must not be empty
+ValueError: dba_open(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n"
+ValueError: dba_open(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t"
+ValueError: dba_open(): Argument #2 ($mode) third character must be "t"
+ValueError: dba_open(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock)
+ValueError: dba_open(): Argument #5 ($map_size) must be greater than or equal to 0
=== Invalid arguments dba_popen() ===
Warning: dba_popen(): Handler "bogus" is not available in %s on line %d
bool(false)
-dba_popen(): Argument #1 ($path) must not be empty
-dba_popen(): Argument #2 ($mode) must not be empty
-dba_popen(): Argument #3 ($handler) must not be empty
-dba_popen(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n"
-dba_popen(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t"
-dba_popen(): Argument #2 ($mode) third character must be "t"
-dba_popen(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock)
-dba_popen(): Argument #5 ($map_size) must be greater than or equal to 0
+ValueError: dba_popen(): Argument #1 ($path) must not be empty
+ValueError: dba_popen(): Argument #2 ($mode) must not be empty
+ValueError: dba_popen(): Argument #3 ($handler) must not be empty
+ValueError: dba_popen(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n"
+ValueError: dba_popen(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t"
+ValueError: dba_popen(): Argument #2 ($mode) third character must be "t"
+ValueError: dba_popen(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock)
+ValueError: dba_popen(): Argument #5 ($map_size) must be greater than or equal to 0
diff --git a/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt b/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt
index cf51c3581a34..56a5d3f24cf4 100644
--- a/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt
+++ b/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt
@@ -19,7 +19,7 @@ function test($method) {
$element->$method($dom2->documentElement->firstChild);
echo "FAIL";
} catch (DOMException $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -29,6 +29,6 @@ test("replaceWith");
?>
--EXPECT--
-Wrong Document Error
-Wrong Document Error
-Wrong Document Error
+DOMException: Wrong Document Error
+DOMException: Wrong Document Error
+DOMException: Wrong Document Error
diff --git a/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt b/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt
index 3890ef08d5b7..2d12af639419 100644
--- a/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt
+++ b/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt
@@ -12,8 +12,8 @@ $element = $dom->createElement('test');
try {
$element->remove();
} catch (DOMException $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Not Found Error
+DOMException: Not Found Error
diff --git a/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt b/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt
index 9a823e370a6e..ada2ee8cbc67 100644
--- a/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt
+++ b/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt
@@ -12,8 +12,8 @@ $dom->loadXML('
other
'); try { $dom->firstChild->firstChild->prepend($dom2->firstChild); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom2->saveHTML()); var_dump($dom->saveHTML()); @@ -94,19 +94,19 @@ string(42) "helloworldfoo
string(39) "worldhello
" -- Append hello with itself -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(39) "helloworld
" -- Append hello with itself and text -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(27) "world
" -- Append world's i tag with the parent -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(39) "helloworld
" -- Append from another document -- -Wrong Document Error +DOMException: Wrong Document Error string(13) "other
" string(39) "helloworld
diff --git a/ext/dom/tests/DOMElement_className.phpt b/ext/dom/tests/DOMElement_className.phpt index fb19f0e23021..184726e1f4ed 100644 --- a/ext/dom/tests/DOMElement_className.phpt +++ b/ext/dom/tests/DOMElement_className.phpt @@ -28,7 +28,7 @@ var_dump($dom->documentElement->className); try { $dom->documentElement->className = new MyStringable(); } catch (Throwable $e) { - echo "Error: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->documentElement->className); echo $dom->saveXML(); @@ -41,7 +41,7 @@ string(0) "" string(2) "é" string(0) "" string(5) "12345" -Error: foo +Exception: foo string(5) "12345"