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..13f25ffe24b9 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(), "\n"; } $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(), "\n"; } $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..d31e687953e2 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(), "\n"; } try { assert((fn&(int... $args): ?bool => $args[0])(false)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..85dab5479ac0 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(), "\n"; } try { assert(new \stdClass instanceof Bar); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(new \stdClass instanceof \Foo\Bar); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..6e7d16eac803 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(), "\n"; } 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(), "\n"; } try { @@ -105,7 +105,7 @@ L0: } })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } try { @@ -138,7 +138,7 @@ assert(0 && ($a = function &(array &...$a) { } })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } ?> --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..e1b52ffae983 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(), "\n"; } 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..e536815750d1 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(), "\n"; } var_dump(\assert(true)); try { var_dump(assert(false)); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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..70cfc0b0e720 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(), "\n"; } ?> --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..64901bd8b36c 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(), "\n"; } try { assert(!is_float(1.1)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(!is_float(1234.5678)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..85c29889b9ba 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(), "\n"; } ?> --EXPECTF-- diff --git a/Zend/tests/ast/zend-pow-assign.phpt b/Zend/tests/ast/zend-pow-assign.phpt index fd8bf8346cec..7b2ae3c75890 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(), "\n"; } ?> --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..095d4c1f2a11 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(), "\n"; } ?> --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/optimizer_shared_cache_slot.phpt b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt index 2e24ad1f8d03..d0452a3ce051 100644 --- a/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt +++ b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt @@ -15,7 +15,7 @@ class C extends P { try { $this->prop = 'overwritten'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($this->prop); } @@ -27,8 +27,8 @@ $c->test(); ?> --EXPECT-- string(7) "default" -Cannot modify private(set) property P::$prop from scope C +Error: Cannot modify private(set) property P::$prop from scope C string(7) "default" string(7) "default" -Cannot modify private(set) property P::$prop from scope C +Error: Cannot modify private(set) property P::$prop from scope C string(7) "default" 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..d124e439b0b5 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(), "\n"; } try { Clazz::TEST3; } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..fc5426eb7242 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(), "\n"; } try { TEST3; } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..2984d1fc2b3d 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(), "\n"; } eval(<<<'CODE' @@ -28,7 +28,7 @@ CODE); try { test2(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } $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(), "\n"; } 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(), "\n"; } 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(), "\n"; } ?> --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..3e3807b8fab3 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(), "\n"; } ?> --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..777d60af5135 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(), "\n"; } ?> --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..c5c11259ec3e 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(), "\n"; } #[\NoDiscard] @@ -26,10 +26,10 @@ function test2(): stdClass { try { test2(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..06fa816ef9da 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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