From 1bb13d679d0d91937dadbcd554e8cb1199d164a2 Mon Sep 17 00:00:00 2001 From: NickSdot Date: Sun, 16 Aug 2026 17:36:08 +0700 Subject: [PATCH] Zend: applied fixers to improve test robustness (part 5/8) --- .../named_params/cannot_pass_by_ref.phpt | 4 +- .../named_params/ctor_extra_named_args.phpt | 8 +-- Zend/tests/named_params/duplicate_param.phpt | 8 +-- Zend/tests/named_params/gh17216.phpt | 4 +- Zend/tests/named_params/missing_param.phpt | 12 ++-- .../named_params/unknown_named_param.phpt | 18 ++--- Zend/tests/named_params/unpack.phpt | 16 ++--- .../named_params/unpack_and_named_1.phpt | 8 +-- Zend/tests/namespaces/ns_076.phpt | 12 ++-- Zend/tests/not_002.phpt | 4 +- Zend/tests/nullsafe_operator/001.phpt | 4 +- Zend/tests/nullsafe_operator/002.phpt | 20 +++--- Zend/tests/nullsafe_operator/003.phpt | 8 +-- Zend/tests/nullsafe_operator/013.phpt | Bin 2909 -> 2938 bytes Zend/tests/nullsafe_operator/014.phpt | 8 +-- Zend/tests/nullsafe_operator/016.phpt | 12 ++-- Zend/tests/nullsafe_operator/026.phpt | 8 +-- Zend/tests/nullsafe_operator/033.phpt | 6 +- Zend/tests/nullsafe_operator/039.phpt | 4 +- .../constant_propagation.phpt | 4 +- ...c_string_must_generate_warning_assign.phpt | 54 +++++++-------- ...numeric_strings_must_generate_warning.phpt | 62 +++++++++--------- Zend/tests/numeric_strings/string_offset.phpt | 18 ++--- Zend/tests/offset_array.phpt | 8 +-- Zend/tests/offset_string.phpt | 20 +++--- Zend/tests/offsets/appending_containers.phpt | 18 ++--- Zend/tests/oss_fuzz_434346548.phpt | 4 +- Zend/tests/pipe_operator/ast.phpt | 52 +++++++-------- Zend/tests/pipe_operator/call_by_ref.phpt | 8 +-- .../pipe_operator/call_prefer_by_ref.phpt | 2 +- .../pipe_operator/oss_fuzz_427814452.phpt | 12 ++-- Zend/tests/pipe_operator/prec_005.phpt | 4 +- Zend/tests/pow_array_leak.phpt | 8 +-- Zend/tests/prop_const_expr/non_enums_rhs.phpt | 6 +- ..._access_errors_for_guarded_properties.phpt | 12 ++-- Zend/tests/property_exists_basic.phpt | 20 +++--- Zend/tests/property_hooks/ast_printing.phpt | 4 +- .../backed_delegated_read_write.phpt | 8 +-- Zend/tests/property_hooks/bug001.phpt | 4 +- Zend/tests/property_hooks/cache.phpt | 12 ++-- .../default_value_inheritance.phpt | 10 +-- .../property_hooks/direct_hook_call.phpt | 8 +-- .../final_prop_promoted_ast.phpt | 4 +- .../property_hooks/foreach_val_to_ref.phpt | 4 +- Zend/tests/property_hooks/get.phpt | 4 +- Zend/tests/property_hooks/get_by_ref.phpt | 8 +-- .../tests/property_hooks/get_by_ref_auto.phpt | 4 +- Zend/tests/property_hooks/get_type_check.phpt | 4 +- Zend/tests/property_hooks/gh15187_3.phpt | 4 +- Zend/tests/property_hooks/gh15644.phpt | 8 +-- Zend/tests/property_hooks/gh16185_002.phpt | 4 +- Zend/tests/property_hooks/gh17101.phpt | 4 +- Zend/tests/property_hooks/gh20270.phpt | 8 +-- .../property_hooks/indirect_modification.phpt | 8 +-- .../property_hooks/magic_interaction.phpt | 10 +-- .../property_hooks/override_add_get.phpt | 4 +- .../property_hooks/override_add_set.phpt | 4 +- .../parent_get_in_class_with_no_parent.phpt | 4 +- .../parent_get_plain_typed_uninitialized.phpt | 4 +- .../property_hooks/parent_get_plain_zpp.phpt | 4 +- .../parent_get_undefined_property.phpt | 4 +- .../property_hooks/parent_set_plain_zpp.phpt | 4 +- .../parent_superfluous_args.phpt | 8 +-- .../parent_wrong_property_info.phpt | 4 +- .../read_sibling_backing_value.phpt | 4 +- Zend/tests/property_hooks/set.phpt | 8 +-- Zend/tests/property_hooks/unset.phpt | 4 +- .../property_hooks/virtual_read_write.phpt | 8 +-- Zend/tests/readonly_classes/gh10377.phpt | 6 +- .../readonly_class_dynamic_property.phpt | 4 +- .../readonly_class_property1.phpt | 4 +- .../readonly_class_property2.phpt | 4 +- .../readonly_class_unserialize_error.phpt | 4 +- .../array_append_initialization.phpt | 8 +-- Zend/tests/readonly_props/by_ref_foreach.phpt | 4 +- Zend/tests/readonly_props/cache_slot.phpt | 20 +++--- Zend/tests/readonly_props/gh7942.phpt | 4 +- .../readonly_props/initialization_scope.phpt | 4 +- Zend/tests/readonly_props/magic_get_set.phpt | 14 ++-- Zend/tests/readonly_props/promotion.phpt | 4 +- .../readonly_assign_no_sideeffect.phpt | 4 +- .../readonly_props/readonly_clone_error1.phpt | 4 +- .../readonly_props/readonly_clone_error2.phpt | 8 +-- .../readonly_props/readonly_clone_error3.phpt | 8 +-- .../readonly_props/readonly_clone_error4.phpt | 8 +-- .../readonly_props/readonly_clone_error5.phpt | 16 ++--- 86 files changed, 394 insertions(+), 394 deletions(-) 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/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 ea35399548916013c54daecbfe675abdff91deaa..775397a941ad9849416ea9aefd85db86ae00efac 100644 GIT binary patch delta 254 zcmcaB_DgKSUY*qBjC=)^R4c3GoW$Z{9R+nO1$7;ufUaG7YKd=ZadBdLs)nYHf>KPL z(#Gqv*|xBCigRmO`go|%Z)C^%wfTUB&IOglfzY%%dsfEG&eP`#5un- zuLNR(!sIy|=6YPkB}JKe=^7@Q3QB&VK0ZoVm8O;ECCBHL=1#WZ)WKnx38x9Fy=9!P UoA+>fGIApvtuR@T+l!G402g~xwg3PC delta 216 zcmew*c2{h|Ua7LgqWF~3+yV`iR9(CD)Dqv+;^M^gR1HndjW1`j@f4R7W#*-8SXyW* zC{6BXPvTSJf(n_NLxhwj%X4TWgv~5L!eJb)2q9BbkkAGWb9uOC6QGD+sE-d^z|;t& ohL_U>NgG%w3|RgetMessage() . "\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/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..0a32dcb1682e 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } try { $a = foxcache(79); $a |= "ea"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } try { $a = foxcache(107); $a &= "aute"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } try { $a = foxcache(139); $a ^= "reprehenderit"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..fd144c1516aa 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } 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(), "\n"; } try { var_dump(79 | "ea"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } try { var_dump(107 & "aute"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } try { var_dump(139 ^ "reprehenderit"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "---", PHP_EOL; var_dump(+"149 in"); try { var_dump(+"voluptate"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "---", PHP_EOL; var_dump(-"151 velit"); try { var_dump(-"esse"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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..7976e43c2d1e 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(), "\n"; } } @@ -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..f7694cebabef 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(), "\n"; } var_dump($str["13"]); try { var_dump($str["14.5"]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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/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..cee8601cf477 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(), "\n"; } try { assert(false && (foo() . bar()) |> baz() . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && foo() . (bar() |> baz()) . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && foo() . bar() |> (baz() . quux())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && (foo() . bar() |> baz()) . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && foo() . (bar() |> baz() . quux())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } 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(), "\n"; } try { assert(false && (foo() < bar()) |> baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && foo() < (bar() |> baz())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && foo() |> bar() < baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && (foo() |> bar()) < baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && foo() |> (bar() < baz())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -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(), "\n"; } ?> --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..25e0c08cf6de 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(), "\n"; } // 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(), "\n"; } ?> --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..62ddc69098de 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(), "\n"; } ?> 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/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..7f888407a9e8 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(), "\n"; } try { var_dump(property_exists(1, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(property_exists(3.14, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(property_exists(true, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(property_exists(null, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } $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..0d6411f6c27d 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(), "\n"; } ?> --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