diff --git a/Zend/tests/dynamic_call/bug77877.phpt b/Zend/tests/dynamic_call/bug77877.phpt index 6ed35213efb2..9c32424de1c2 100644 --- a/Zend/tests/dynamic_call/bug77877.phpt +++ b/Zend/tests/dynamic_call/bug77877.phpt @@ -10,14 +10,14 @@ class Foo { try { array_map([new Foo, 'bar'],[1]); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func([new Foo, 'bar']); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Using $this when not in object context -Using $this when not in object context +Error: Using $this when not in object context +Error: Using $this when not in object context diff --git a/Zend/tests/dynamic_call/dynamic_call_005.phpt b/Zend/tests/dynamic_call/dynamic_call_005.phpt index 91d1cb914c12..e0411683ee04 100644 --- a/Zend/tests/dynamic_call/dynamic_call_005.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_005.phpt @@ -10,27 +10,27 @@ function test_calls($func) { array_map($func, [['i' => new stdClass]]); var_dump($i); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func(['i' => new stdClass]); var_dump($i); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func($func, ['i' => new stdClass]); var_dump($i); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test_calls('extract'); ?> --EXPECT-- -Cannot call extract() dynamically -Cannot call extract() dynamically -Cannot call extract() dynamically +Error: Cannot call extract() dynamically +Error: Cannot call extract() dynamically +Error: Cannot call extract() dynamically diff --git a/Zend/tests/dynamic_call/dynamic_call_006.phpt b/Zend/tests/dynamic_call/dynamic_call_006.phpt index e6ea71915854..cfb17729b75f 100644 --- a/Zend/tests/dynamic_call/dynamic_call_006.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_006.phpt @@ -8,51 +8,51 @@ function test() { $func = 'extract'; $func(['a' => 'b']); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'compact'; $func(['a']); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'get_defined_vars'; $func(); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'func_get_args'; $func(); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'func_get_arg'; $func(1); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'func_num_args'; $func(); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(); ?> --EXPECT-- -Cannot call extract() dynamically -Cannot call compact() dynamically -Cannot call get_defined_vars() dynamically -Cannot call func_get_args() dynamically -Cannot call func_get_arg() dynamically -Cannot call func_num_args() dynamically +Error: Cannot call extract() dynamically +Error: Cannot call compact() dynamically +Error: Cannot call get_defined_vars() dynamically +Error: Cannot call func_get_args() dynamically +Error: Cannot call func_get_arg() dynamically +Error: Cannot call func_num_args() dynamically diff --git a/Zend/tests/dynamic_call/dynamic_call_007.phpt b/Zend/tests/dynamic_call/dynamic_call_007.phpt index f1312b95b47a..484a3322bf90 100644 --- a/Zend/tests/dynamic_call/dynamic_call_007.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_007.phpt @@ -8,7 +8,7 @@ function test() { try { array_map('extract', [['i' => new stdClass]]); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $i += 1; var_dump($i); @@ -17,5 +17,5 @@ test(); ?> --EXPECT-- -Cannot call extract() dynamically +Error: Cannot call extract() dynamically int(2) diff --git a/Zend/tests/dynamic_call/dynamic_call_008.phpt b/Zend/tests/dynamic_call/dynamic_call_008.phpt index 1916bcf91345..f2a0e6c4d578 100644 --- a/Zend/tests/dynamic_call/dynamic_call_008.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_008.phpt @@ -7,11 +7,11 @@ function test() { try { ((string) 'extract')(['a' => 42]); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(); ?> --EXPECT-- -Cannot call extract() dynamically +Error: Cannot call extract() dynamically diff --git a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt index 1bba3ebf6be1..185ab33629b3 100644 --- a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt @@ -7,22 +7,22 @@ try { $bar = "bar"; ("foo" . $bar)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $bar = ["bar"]; (["foo"] + $bar)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (new stdClass)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function foobar() -Array callback must have exactly two elements -Object of type stdClass is not callable +Error: Call to undefined function foobar() +Error: Array callback must have exactly two elements +Error: Object of type stdClass is not callable diff --git a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt index f73d29a131d6..0f521d3273ac 100644 --- a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt @@ -17,14 +17,14 @@ $x = new Foo; try { $x->test1(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x->test2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Non-static method Foo::bar() cannot be called statically -Non-static method Foo::bar() cannot be called statically +Error: Non-static method Foo::bar() cannot be called statically +Error: Non-static method Foo::bar() cannot be called statically diff --git a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt index cca6fa38b6c3..e709485a578c 100644 --- a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt +++ b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt @@ -7,9 +7,9 @@ namespace Foo; try { ('\bar')(); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function bar() +Error: Call to undefined function bar() diff --git a/Zend/tests/dynamic_prop_deprecation_002.phpt b/Zend/tests/dynamic_prop_deprecation_002.phpt index bd0d3aa5a7df..980bbef7d8dd 100644 --- a/Zend/tests/dynamic_prop_deprecation_002.phpt +++ b/Zend/tests/dynamic_prop_deprecation_002.phpt @@ -10,9 +10,9 @@ $a = new class{}; try { [&$a->y]; } catch (Throwable $ex) { - echo "Exception: " .$ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- Err: Creation of dynamic property class@anonymous::$y is deprecated -Exception: Cannot create dynamic property class@anonymous::$y +Error: Cannot create dynamic property class@anonymous::$y diff --git a/Zend/tests/enum/ast-dumper.phpt b/Zend/tests/enum/ast-dumper.phpt index 7972fe64965e..106ab55e1da6 100644 --- a/Zend/tests/enum/ast-dumper.phpt +++ b/Zend/tests/enum/ast-dumper.phpt @@ -23,12 +23,12 @@ try { return false; })()); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert((function () { +AssertionError: assert((function () { enum Foo { case Bar; } diff --git a/Zend/tests/enum/backed-duplicate-int.phpt b/Zend/tests/enum/backed-duplicate-int.phpt index fb64ff29322e..4eade51093a5 100644 --- a/Zend/tests/enum/backed-duplicate-int.phpt +++ b/Zend/tests/enum/backed-duplicate-int.phpt @@ -11,30 +11,30 @@ enum Foo: int { try { var_dump(Foo::Bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::Bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::from(42)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::tryFrom('bar')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Duplicate value in enum Foo for cases Bar and Baz -Duplicate value in enum Foo for cases Bar and Baz -Duplicate value in enum Foo for cases Bar and Baz -Foo::tryFrom(): Argument #1 ($value) must be of type int, string given +Error: Duplicate value in enum Foo for cases Bar and Baz +Error: Duplicate value in enum Foo for cases Bar and Baz +Error: Duplicate value in enum Foo for cases Bar and Baz +TypeError: Foo::tryFrom(): Argument #1 ($value) must be of type int, string given diff --git a/Zend/tests/enum/backed-duplicate-string.phpt b/Zend/tests/enum/backed-duplicate-string.phpt index 22224ada35a3..24d76debb794 100644 --- a/Zend/tests/enum/backed-duplicate-string.phpt +++ b/Zend/tests/enum/backed-duplicate-string.phpt @@ -13,30 +13,30 @@ enum Suit: string { try { var_dump(Suit::Hearts); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Suit::Hearts); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Suit::from(42)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Suit::tryFrom('bar')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Duplicate value in enum Suit for cases Hearts and Spades -Duplicate value in enum Suit for cases Hearts and Spades -Duplicate value in enum Suit for cases Hearts and Spades -Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades diff --git a/Zend/tests/enum/backed-from-invalid-int.phpt b/Zend/tests/enum/backed-from-invalid-int.phpt index d40cae30e6c8..d6c48b9f74f4 100644 --- a/Zend/tests/enum/backed-from-invalid-int.phpt +++ b/Zend/tests/enum/backed-from-invalid-int.phpt @@ -11,9 +11,9 @@ enum Foo: int { try { var_dump(Foo::from(2)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -2 is not a valid backing value for enum Foo +ValueError: 2 is not a valid backing value for enum Foo diff --git a/Zend/tests/enum/backed-from-invalid-string.phpt b/Zend/tests/enum/backed-from-invalid-string.phpt index c6d784872ef0..4c27d75d2ac1 100644 --- a/Zend/tests/enum/backed-from-invalid-string.phpt +++ b/Zend/tests/enum/backed-from-invalid-string.phpt @@ -13,9 +13,9 @@ enum Suit: string { try { var_dump(Suit::from('A')); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -"A" is not a valid backing value for enum Suit +ValueError: "A" is not a valid backing value for enum Suit diff --git a/Zend/tests/enum/backed-from-invalid-type.phpt b/Zend/tests/enum/backed-from-invalid-type.phpt index b4e0e6d6164f..9928f262b15b 100644 --- a/Zend/tests/enum/backed-from-invalid-type.phpt +++ b/Zend/tests/enum/backed-from-invalid-type.phpt @@ -13,7 +13,7 @@ enum Suit: string { try { var_dump(Suit::from(42)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } enum Foo: int { @@ -24,11 +24,11 @@ enum Foo: int { try { var_dump(Foo::from('H')); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -"42" is not a valid backing value for enum Suit -Foo::from(): Argument #1 ($value) must be of type int, string given +ValueError: "42" is not a valid backing value for enum Suit +TypeError: Foo::from(): Argument #1 ($value) must be of type int, string given diff --git a/Zend/tests/enum/backed-mismatch.phpt b/Zend/tests/enum/backed-mismatch.phpt index 73602f7b15b4..d02953016b1d 100644 --- a/Zend/tests/enum/backed-mismatch.phpt +++ b/Zend/tests/enum/backed-mismatch.phpt @@ -10,25 +10,25 @@ enum Foo: int { try { var_dump(Foo::Bar); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::Bar); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::from(42)); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::from('bar')); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/enum/enum-as-params.phpt b/Zend/tests/enum/enum-as-params.phpt index 90a1f0b5d07f..a06804d04631 100644 --- a/Zend/tests/enum/enum-as-params.phpt +++ b/Zend/tests/enum/enum-as-params.phpt @@ -20,16 +20,16 @@ takesBaz(Baz::Qux); try { takesBaz(Foo::Bar); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { takesFoo(Baz::Qux); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d -takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d +TypeError: takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d +TypeError: takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d diff --git a/Zend/tests/enum/internal_enums.phpt b/Zend/tests/enum/internal_enums.phpt index ae26e24cd7ea..d642b9e9764f 100644 --- a/Zend/tests/enum/internal_enums.phpt +++ b/Zend/tests/enum/internal_enums.phpt @@ -34,7 +34,7 @@ function test_int_enum(int|string $case) { try { var_dump(ZendTestIntEnum::from($case)); } catch (\Error $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(ZendTestIntEnum::tryFrom($case)); } diff --git a/Zend/tests/enum/internal_enums_strict_types.phpt b/Zend/tests/enum/internal_enums_strict_types.phpt index 3d5ea231a271..183c87b26cca 100644 --- a/Zend/tests/enum/internal_enums_strict_types.phpt +++ b/Zend/tests/enum/internal_enums_strict_types.phpt @@ -12,17 +12,17 @@ var_dump(ZendTestStringEnum::from("Test2")); try { var_dump(ZendTestStringEnum::from(42)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ZendTestStringEnum::tryFrom(43)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- enum(ZendTestStringEnum::Bar) -ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given -ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given +TypeError: ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given +TypeError: ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given diff --git a/Zend/tests/enum/json_encode.phpt b/Zend/tests/enum/json_encode.phpt index f1174db7ae8e..ef59b63ccf65 100644 --- a/Zend/tests/enum/json_encode.phpt +++ b/Zend/tests/enum/json_encode.phpt @@ -35,7 +35,7 @@ function test($value) { var_dump(json_encode($value, JSON_THROW_ON_ERROR)); echo json_last_error_msg() . "\n"; } catch (Exception $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/enum/no-clone-internal.phpt b/Zend/tests/enum/no-clone-internal.phpt index 84b7ee2634d2..58d9aba276a8 100644 --- a/Zend/tests/enum/no-clone-internal.phpt +++ b/Zend/tests/enum/no-clone-internal.phpt @@ -8,9 +8,9 @@ zend_test try { var_dump(clone ZendTestIntEnum::Foo); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class ZendTestIntEnum +Error: Trying to clone an uncloneable object of class ZendTestIntEnum diff --git a/Zend/tests/enum/no-clone.phpt b/Zend/tests/enum/no-clone.phpt index 2fadbb26b720..806ab0ae49ee 100644 --- a/Zend/tests/enum/no-clone.phpt +++ b/Zend/tests/enum/no-clone.phpt @@ -10,9 +10,9 @@ enum Foo { try { var_dump(clone Foo::Bar); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class Foo +Error: Trying to clone an uncloneable object of class Foo diff --git a/Zend/tests/enum/no-dynamic-properties-internal.phpt b/Zend/tests/enum/no-dynamic-properties-internal.phpt index 8d821a5f6292..e58d8c9b642a 100644 --- a/Zend/tests/enum/no-dynamic-properties-internal.phpt +++ b/Zend/tests/enum/no-dynamic-properties-internal.phpt @@ -10,9 +10,9 @@ $bar = ZendTestUnitEnum::Bar; try { $bar->baz = 'Baz'; } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create dynamic property ZendTestUnitEnum::$baz +Error: Cannot create dynamic property ZendTestUnitEnum::$baz diff --git a/Zend/tests/enum/no-dynamic-properties.phpt b/Zend/tests/enum/no-dynamic-properties.phpt index 83d0d441b458..51312b752b69 100644 --- a/Zend/tests/enum/no-dynamic-properties.phpt +++ b/Zend/tests/enum/no-dynamic-properties.phpt @@ -12,9 +12,9 @@ $bar = Foo::Bar; try { $bar->baz = 'Baz'; } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create dynamic property Foo::$baz +Error: Cannot create dynamic property Foo::$baz diff --git a/Zend/tests/enum/no-new-through-reflection.phpt b/Zend/tests/enum/no-new-through-reflection.phpt index 9a92559cd3d6..7807e2cb388f 100644 --- a/Zend/tests/enum/no-new-through-reflection.phpt +++ b/Zend/tests/enum/no-new-through-reflection.phpt @@ -8,9 +8,9 @@ enum Foo {} try { (new \ReflectionClass(Foo::class))->newInstanceWithoutConstructor(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate enum Foo +Error: Cannot instantiate enum Foo diff --git a/Zend/tests/enum/no-new.phpt b/Zend/tests/enum/no-new.phpt index 698e9548827f..b9c36dfa6b36 100644 --- a/Zend/tests/enum/no-new.phpt +++ b/Zend/tests/enum/no-new.phpt @@ -8,9 +8,9 @@ enum Foo {} try { new Foo(); } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate enum Foo +Error: Cannot instantiate enum Foo diff --git a/Zend/tests/enum/no-pass-properties-by-ref.phpt b/Zend/tests/enum/no-pass-properties-by-ref.phpt index 21c3a41e9352..1d5d34f45c57 100644 --- a/Zend/tests/enum/no-pass-properties-by-ref.phpt +++ b/Zend/tests/enum/no-pass-properties-by-ref.phpt @@ -15,12 +15,12 @@ try { $bar = Foo::Bar; $value = setBarValueByRef($bar->value, 1); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-return-properties-by-ref.phpt b/Zend/tests/enum/no-return-properties-by-ref.phpt index ea68e7a585cc..117eb1a7a119 100644 --- a/Zend/tests/enum/no-return-properties-by-ref.phpt +++ b/Zend/tests/enum/no-return-properties-by-ref.phpt @@ -16,12 +16,12 @@ try { $value = &getBarValueByRef(); $value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-unset-propertes.phpt b/Zend/tests/enum/no-unset-propertes.phpt index 867c853afa76..49a19fbffadb 100644 --- a/Zend/tests/enum/no-unset-propertes.phpt +++ b/Zend/tests/enum/no-unset-propertes.phpt @@ -15,23 +15,23 @@ $foo = Foo::Bar; try { unset($foo->name); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $intFoo = IntFoo::Bar; try { unset($intFoo->name); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($intFoo->value); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot unset readonly property Foo::$name -Cannot unset readonly property IntFoo::$name -Cannot unset readonly property IntFoo::$value +Error: Cannot unset readonly property Foo::$name +Error: Cannot unset readonly property IntFoo::$name +Error: Cannot unset readonly property IntFoo::$value diff --git a/Zend/tests/enum/no-write-properties-cache-slot.phpt b/Zend/tests/enum/no-write-properties-cache-slot.phpt index d59268b6912e..cb1c6bad5a9f 100644 --- a/Zend/tests/enum/no-write-properties-cache-slot.phpt +++ b/Zend/tests/enum/no-write-properties-cache-slot.phpt @@ -16,12 +16,12 @@ enum Test { try { Test::A->modify(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Test::A->name); ?> --EXPECT-- string(1) "A" -Cannot modify readonly property Test::$name +Error: Cannot modify readonly property Test::$name string(1) "A" diff --git a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt index b02f49932904..f8507117f5be 100644 --- a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt +++ b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt @@ -11,12 +11,12 @@ try { $bar = Foo::Bar; foreach ([1] as &$bar->value) {} } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-write-properties-through-references.phpt b/Zend/tests/enum/no-write-properties-through-references.phpt index 17bd57b82ea2..0ba34e6c04a3 100644 --- a/Zend/tests/enum/no-write-properties-through-references.phpt +++ b/Zend/tests/enum/no-write-properties-through-references.phpt @@ -12,12 +12,12 @@ try { $value = &$bar->value; $value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-write-properties.phpt b/Zend/tests/enum/no-write-properties.phpt index e0022cfffe76..6eb80460f254 100644 --- a/Zend/tests/enum/no-write-properties.phpt +++ b/Zend/tests/enum/no-write-properties.phpt @@ -15,35 +15,35 @@ $bar = Foo::Bar; try { $bar->name = 'Baz'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $bar->value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $intBar = IntFoo::Bar; try { $intBar->name = 'Baz'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $intBar->value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $intBar->value2 = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$name -Cannot create dynamic property Foo::$value -Cannot modify readonly property IntFoo::$name -Cannot modify readonly property IntFoo::$value -Cannot create dynamic property IntFoo::$value2 +Error: Cannot modify readonly property Foo::$name +Error: Cannot create dynamic property Foo::$value +Error: Cannot modify readonly property IntFoo::$name +Error: Cannot modify readonly property IntFoo::$value +Error: Cannot create dynamic property IntFoo::$value2 diff --git a/Zend/tests/errmsg/bug43344_1.phpt b/Zend/tests/errmsg/bug43344_1.phpt index d517373d9f17..a8413f04afd2 100644 --- a/Zend/tests/errmsg/bug43344_1.phpt +++ b/Zend/tests/errmsg/bug43344_1.phpt @@ -19,27 +19,27 @@ function f3($a=array(bar=>0)) { try { echo bar."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo f1()."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo f2()."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo f3()."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "Foo\bar" -Undefined constant "Foo\bar" -Undefined constant "Foo\bar" -Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" diff --git a/Zend/tests/errmsg/errmsg_020.phpt b/Zend/tests/errmsg/errmsg_020.phpt index 4a7c326d0531..ea9429561aac 100644 --- a/Zend/tests/errmsg/errmsg_020.phpt +++ b/Zend/tests/errmsg/errmsg_020.phpt @@ -8,9 +8,9 @@ disable_functions=phpinfo try { phpinfo(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function phpinfo() +Error: Call to undefined function phpinfo() diff --git a/Zend/tests/error_reporting/bug72162.phpt b/Zend/tests/error_reporting/bug72162.phpt index 721b0fc30680..570e17522f21 100644 --- a/Zend/tests/error_reporting/bug72162.phpt +++ b/Zend/tests/error_reporting/bug72162.phpt @@ -8,8 +8,8 @@ $var11 = new StdClass(); try { $var16 = error_reporting($var11); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given +TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given diff --git a/Zend/tests/eval_constant_resolution.phpt b/Zend/tests/eval_constant_resolution.phpt index d302d50a2c05..44bbe4b24bcd 100644 --- a/Zend/tests/eval_constant_resolution.phpt +++ b/Zend/tests/eval_constant_resolution.phpt @@ -20,4 +20,4 @@ Outside eval bool(true) bool(true) string(4) "test" -bool(true) \ No newline at end of file +bool(true) diff --git a/Zend/tests/exception_set_previous_leak.phpt b/Zend/tests/exception_set_previous_leak.phpt index 7fb680f95168..6208b45503c4 100644 --- a/Zend/tests/exception_set_previous_leak.phpt +++ b/Zend/tests/exception_set_previous_leak.phpt @@ -12,9 +12,9 @@ try { throw $e; } } catch (Exception $e2) { - echo $e2->getMessage(), "\n"; + echo $e2::class, ': ', $e2->getMessage(), "\n"; } ?> --EXPECT-- -Test +Exception: Test diff --git a/Zend/tests/exception_stream_wrapper.phpt b/Zend/tests/exception_stream_wrapper.phpt index 4de8274fe0c1..7f81fc7f9fb6 100644 --- a/Zend/tests/exception_stream_wrapper.phpt +++ b/Zend/tests/exception_stream_wrapper.phpt @@ -21,7 +21,7 @@ stream_wrapper_register('abc', 'Loader'); try { require 'abc://'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -29,4 +29,4 @@ try { stream_set_option stream_stat stream_read -Message +Exception: Message diff --git a/Zend/tests/exceptions/bug26698.phpt b/Zend/tests/exceptions/bug26698.phpt index 8155f2090595..cf5e149ab9a7 100644 --- a/Zend/tests/exceptions/bug26698.phpt +++ b/Zend/tests/exceptions/bug26698.phpt @@ -26,7 +26,7 @@ class Proxy } catch(Exception $e) { - echo 'Caught: '.$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -39,7 +39,7 @@ class Proxy } catch(Exception $e) { - echo 'Caught: '.$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -52,7 +52,7 @@ class Proxy } catch(Exception $e) { - echo 'Caught: '.$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -64,6 +64,6 @@ $p->callTwo(); $p->callThree(); ?> --EXPECT-- -Caught: NONE -Caught: NONE -Caught: NONE +Exception: NONE +Exception: NONE +Exception: NONE diff --git a/Zend/tests/exceptions/bug31102.phpt b/Zend/tests/exceptions/bug31102.phpt index 17beec6ba389..e82a2af8b564 100644 --- a/Zend/tests/exceptions/bug31102.phpt +++ b/Zend/tests/exceptions/bug31102.phpt @@ -31,16 +31,16 @@ while($test++ < 5) } catch (Exception $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> ===DONE=== --EXPECTF-- {closure:%s:%d}(Test1,1) -Caught: Test1::__construct +Exception: Test1::__construct {closure:%s:%d}(Test2,2) -Caught: {closure:%s:%d} +Exception: {closure:%s:%d} {closure:%s:%d}(Test3,3) Fatal error: Uncaught Error: Class "Test3" not found in %s:%d diff --git a/Zend/tests/exceptions/bug47771.phpt b/Zend/tests/exceptions/bug47771.phpt index c4350b9d95d3..b1792b0f3c97 100644 --- a/Zend/tests/exceptions/bug47771.phpt +++ b/Zend/tests/exceptions/bug47771.phpt @@ -23,7 +23,7 @@ try { $T =new Test(throw_exc()); } catch( Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/Zend/tests/exceptions/bug48428.phpt b/Zend/tests/exceptions/bug48428.phpt index 0cda84dea4ee..68ab915124bb 100644 --- a/Zend/tests/exceptions/bug48428.phpt +++ b/Zend/tests/exceptions/bug48428.phpt @@ -6,8 +6,8 @@ try { function x() { throw new Exception("ERROR"); } x(x()); } catch(Exception $e) { - echo($e -> getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ERROR +Exception: ERROR diff --git a/Zend/tests/exceptions/bug50383.phpt b/Zend/tests/exceptions/bug50383.phpt index 2f72ea51f853..bb52e472611a 100644 --- a/Zend/tests/exceptions/bug50383.phpt +++ b/Zend/tests/exceptions/bug50383.phpt @@ -5,10 +5,10 @@ Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and l class myClass { public static function __callStatic($method, $args) { - throw new Exception("Missing static method '$method'\n"); + throw new Exception("Missing static method '$method'"); } public function __call($method, $args) { - throw new Exception("Missing method '$method'\n"); + throw new Exception("Missing method '$method'"); } } @@ -23,20 +23,20 @@ function thrower2() { try { thrower(); } catch(Exception $e) { - print $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; print_r($e->getTrace()); } try { thrower2(); } catch (Exception $e) { - print $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; print_r($e->getTrace()); } ?> --EXPECTF-- -Missing static method 'ThrowException' +Exception: Missing static method 'ThrowException' Array ( [0] => Array @@ -69,7 +69,7 @@ Array ) ) -Missing method 'foo' +Exception: Missing method 'foo' Array ( [0] => Array diff --git a/Zend/tests/exceptions/bug53511.phpt b/Zend/tests/exceptions/bug53511.phpt index b07504506a94..caa9f7fc7696 100644 --- a/Zend/tests/exceptions/bug53511.phpt +++ b/Zend/tests/exceptions/bug53511.phpt @@ -13,7 +13,7 @@ function test() { try { throw new Exception("ops 2"); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/exceptions/bug54043.phpt b/Zend/tests/exceptions/bug54043.phpt index c6e08b75f9ee..e8e487f36840 100644 --- a/Zend/tests/exceptions/bug54043.phpt +++ b/Zend/tests/exceptions/bug54043.phpt @@ -9,12 +9,12 @@ $timeZone = new DateTimeZone('UTC'); try { $dateTime = new DateTime($time, $timeZone); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(error_get_last()); ?> --EXPECT-- -string(80) "Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character" +DateMalformedStringException: Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character NULL diff --git a/Zend/tests/exceptions/bug60569.phpt b/Zend/tests/exceptions/bug60569.phpt index ef3bea8edb78..20af436a72c7 100644 --- a/Zend/tests/exceptions/bug60569.phpt +++ b/Zend/tests/exceptions/bug60569.phpt @@ -6,9 +6,10 @@ try { $msg = "Some error \x00 message"; throw new Exception($msg); } catch(Exception $e) { - var_dump($e->getMessage(), $msg); + echo $e::class, ': ', $e->getMessage(), "\n"; + var_dump($msg); } ?> --EXPECTF-- -string(20) "Some error %0 message" +Exception: Some error %0 message string(20) "Some error %0 message" diff --git a/Zend/tests/exceptions/exception_001.phpt b/Zend/tests/exceptions/exception_001.phpt index aba29d4aa3ee..0f0cd52702e9 100644 --- a/Zend/tests/exceptions/exception_001.phpt +++ b/Zend/tests/exceptions/exception_001.phpt @@ -9,28 +9,28 @@ try { try { throw new Exception(); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } ?> --EXPECTF-- -string(0) "" -string(0) "" -string(0) "" -string(0) "" +Exception: +Exception: +Exception: +Exception: Fatal error: Uncaught Exception in %s:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_013.phpt b/Zend/tests/exceptions/exception_013.phpt index 93d85761764b..20358f5a3e1e 100644 --- a/Zend/tests/exceptions/exception_013.phpt +++ b/Zend/tests/exceptions/exception_013.phpt @@ -9,29 +9,27 @@ class C { try { var_dump(C::$a); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } try { var_dump(C::$p); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } try { unset(C::$a); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } var_dump(C::$a); ?> --EXPECTF-- -Exception: Access to undeclared static property C::$a in %s on line %d - -Exception: Cannot access private property C::$p in %sexception_013.php on line 13 - -Exception: Attempt to unset static property C::$a in %sexception_013.php on line 19 +Error: Access to undeclared static property C::$a in %s on line %d +Error: Cannot access private property C::$p in %sexception_013.php on line 13 +Error: Attempt to unset static property C::$a in %sexception_013.php on line 19 Fatal error: Uncaught Error: Access to undeclared static property C::$a in %s:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_014.phpt b/Zend/tests/exceptions/exception_014.phpt index aaf411dae56c..fb9e26ae2135 100644 --- a/Zend/tests/exceptions/exception_014.phpt +++ b/Zend/tests/exceptions/exception_014.phpt @@ -10,13 +10,13 @@ $x = new C; try { var_dump($x->p); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } var_dump($x->p); ?> --EXPECTF-- -Exception: Cannot access private property C::$p in %sexception_014.php on line %d +Error: Cannot access private property C::$p in %sexception_014.php on line %d Fatal error: Uncaught Error: Cannot access private property C::$p in %sexception_014.php:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_015.phpt b/Zend/tests/exceptions/exception_015.phpt index a2b27154f657..8ca146054e04 100644 --- a/Zend/tests/exceptions/exception_015.phpt +++ b/Zend/tests/exceptions/exception_015.phpt @@ -6,13 +6,13 @@ $s = "ABC"; try { $s[] = "D"; } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } $s[] = "D"; ?> --EXPECTF-- -Exception: [] operator not supported for strings in %sexception_015.php on line %d +Error: [] operator not supported for strings in %sexception_015.php on line %d Fatal error: Uncaught Error: [] operator not supported for strings in %sexception_015.php:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_016.phpt b/Zend/tests/exceptions/exception_016.phpt index 5b52cf72cd7a..6b572c8eb37f 100644 --- a/Zend/tests/exceptions/exception_016.phpt +++ b/Zend/tests/exceptions/exception_016.phpt @@ -5,13 +5,13 @@ Exceptions on improper usage of $this try { $this->foo(); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } $this->foo(); ?> --EXPECTF-- -Exception: Using $this when not in object context in %sexception_016.php on line %d +Error: Using $this when not in object context in %sexception_016.php on line %d Fatal error: Uncaught Error: Using $this when not in object context in %sexception_016.php:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_before_fatal.phpt b/Zend/tests/exceptions/exception_before_fatal.phpt index edc63b2394cd..cd0c2d518a8a 100644 --- a/Zend/tests/exceptions/exception_before_fatal.phpt +++ b/Zend/tests/exceptions/exception_before_fatal.phpt @@ -11,38 +11,38 @@ set_error_handler("exception_error_handler"); try { $foo->a(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new $foo(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { throw $foo; } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $foo(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $foo::b(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = clone $foo; } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } class b { @@ -51,14 +51,14 @@ class b { try { b::$foo(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo diff --git a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt index 5732e8cc5af7..dac064e5b364 100644 --- a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt +++ b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt @@ -15,9 +15,9 @@ $y = 5; try { $test->x =& $y; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Foobar +Exception: Foobar diff --git a/Zend/tests/exceptions/exception_during_include_stat.phpt b/Zend/tests/exceptions/exception_during_include_stat.phpt index 62747384e713..5b9fd071eea7 100644 --- a/Zend/tests/exceptions/exception_during_include_stat.phpt +++ b/Zend/tests/exceptions/exception_during_include_stat.phpt @@ -16,27 +16,27 @@ set_include_path('test://foo:test://bar'); try { require_once 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { require 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { include_once 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { include 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -stat failed -stat failed -stat failed -stat failed +Exception: stat failed +Exception: stat failed +Exception: stat failed +Exception: stat failed diff --git a/Zend/tests/exceptions/exception_from_toString.phpt b/Zend/tests/exceptions/exception_from_toString.phpt index dd4de341caf2..66b6e4bc6928 100644 --- a/Zend/tests/exceptions/exception_from_toString.phpt +++ b/Zend/tests/exceptions/exception_from_toString.phpt @@ -14,78 +14,78 @@ $num = 42; $badStr = new BadStr; try { $x = $str . $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $badStr . $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $str .= $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); try { $x = $num . $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $badStr . $num; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $num .= $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($num); try { $x = $badStr .= $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($badStr); try { $x = $badStr .= $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($badStr); try { $x = "x$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "{$badStr}x"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "$str$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "$badStr$str"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "x$badStr$str"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "x$str$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "{$str}x$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "{$badStr}x$str"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = (string) $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = include $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } ${""} = 42; try { unset(${$badStr}); } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(${""}); unset(${""}); try { $x = ${$badStr}; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = isset(${$badStr}); } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = new stdClass; try { $x = $obj->{$badStr} = $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($obj); try { $str[0] = $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); $obj = new DateInterval('P1D'); try { $x = $obj->{$badStr} = $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(!isset($obj->{""})); try { strlen($badStr); } catch (Exception $e) { echo "Exception\n"; } @@ -94,41 +94,41 @@ try { new ArrayObject([], 0, $badStr); } catch (Exception $e) { echo "Exception\ ?> --EXPECT-- -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception string(1) "a" -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception int(42) -Exception +Exception: Exception object(BadStr)#1 (0) { } -Exception +Exception: Exception object(BadStr)#1 (0) { } -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception int(42) -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception object(stdClass)#2 (0) { } -Exception +Exception: Exception string(1) "a" -Exception +Exception: Exception bool(true) Exception Exception diff --git a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt index a9f9e77a59d9..d7b1623e8802 100644 --- a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt +++ b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt @@ -6,15 +6,15 @@ exception handler tests - 4 try { set_exception_handler("fo"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { set_exception_handler(array("", "")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name -set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found +TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name +TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found diff --git a/Zend/tests/exit/die_string_cast_exception.phpt b/Zend/tests/exit/die_string_cast_exception.phpt index c20a873939df..f500ec57820d 100644 --- a/Zend/tests/exit/die_string_cast_exception.phpt +++ b/Zend/tests/exit/die_string_cast_exception.phpt @@ -6,9 +6,9 @@ Bug #79777: String cast exception during die should be handled gracefully try { die(new stdClass); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -exit(): Argument #1 ($status) must be of type string|int, stdClass given +TypeError: exit(): Argument #1 ($status) must be of type string|int, stdClass given diff --git a/Zend/tests/exit_finally_2.phpt b/Zend/tests/exit_finally_2.phpt index 0a3f5dc7a1d1..d8a977edb680 100644 --- a/Zend/tests/exit_finally_2.phpt +++ b/Zend/tests/exit_finally_2.phpt @@ -15,7 +15,7 @@ try { } echo "Not executed\n"; } catch (Exception $e) { - echo "Caught {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/fe_fetch_dtor_exception.phpt b/Zend/tests/fe_fetch_dtor_exception.phpt index 99378e739a8b..362c0e65cfbc 100644 --- a/Zend/tests/fe_fetch_dtor_exception.phpt +++ b/Zend/tests/fe_fetch_dtor_exception.phpt @@ -14,9 +14,9 @@ try { var_dump($v); } } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -foo +Exception: foo diff --git a/Zend/tests/fe_fetch_op2_live_range.phpt b/Zend/tests/fe_fetch_op2_live_range.phpt index c601e43120e0..1c1df1f279c7 100644 --- a/Zend/tests/fe_fetch_op2_live_range.phpt +++ b/Zend/tests/fe_fetch_op2_live_range.phpt @@ -5,8 +5,8 @@ FE_FETCH op2 is a def and needs special live range handling try { foreach (["test"] as $k => func()[]) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function func() +Error: Call to undefined function func() diff --git a/Zend/tests/fibers/catch.phpt b/Zend/tests/fibers/catch.phpt index 92c139ca1b4d..45ef21348c0a 100644 --- a/Zend/tests/fibers/catch.phpt +++ b/Zend/tests/fibers/catch.phpt @@ -7,7 +7,7 @@ $fiber = new Fiber(function () { try { Fiber::suspend('test'); } catch (Exception $exception) { - var_dump($exception->getMessage()); + echo $exception::class, ': ', $exception->getMessage(), "\n"; } }); @@ -19,4 +19,4 @@ $fiber->throw(new Exception('test')); ?> --EXPECT-- string(4) "test" -string(4) "test" +Exception: test diff --git a/Zend/tests/fibers/fiber-error-construct.phpt b/Zend/tests/fibers/fiber-error-construct.phpt index 8af23ff86ebd..4b3ac43b7689 100644 --- a/Zend/tests/fibers/fiber-error-construct.phpt +++ b/Zend/tests/fibers/fiber-error-construct.phpt @@ -6,9 +6,9 @@ FiberError cannot be constructed in user code try { new FiberError; } catch (Error $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -The "FiberError" class is reserved for internal use and cannot be manually instantiated +Error: The "FiberError" class is reserved for internal use and cannot be manually instantiated diff --git a/Zend/tests/fibers/get-return-after-throwing.phpt b/Zend/tests/fibers/get-return-after-throwing.phpt index 620f74e3239c..4d401a898ea6 100644 --- a/Zend/tests/fibers/get-return-after-throwing.phpt +++ b/Zend/tests/fibers/get-return-after-throwing.phpt @@ -8,14 +8,14 @@ $fiber = new Fiber(fn() => throw new Exception('test')); try { $fiber->start(); } catch (Exception $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $fiber->getReturn(); ?> --EXPECTF-- -test +Exception: test Fatal error: Uncaught FiberError: Cannot get fiber return value: The fiber threw an exception in %sget-return-after-throwing.php:%d Stack trace: diff --git a/Zend/tests/fibers/gh10249.phpt b/Zend/tests/fibers/gh10249.phpt index efbef9c42a2e..ae8b1ddee966 100644 --- a/Zend/tests/fibers/gh10249.phpt +++ b/Zend/tests/fibers/gh10249.phpt @@ -9,9 +9,9 @@ $fiber = new Fiber($callback); try { $fiber->start(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Fiber stack size is too small, it needs to be at least %d bytes +Exception: Fiber stack size is too small, it needs to be at least %d bytes diff --git a/Zend/tests/fibers/gh20483.phpt b/Zend/tests/fibers/gh20483.phpt index e06cf87258ea..c87263c171ab 100644 --- a/Zend/tests/fibers/gh20483.phpt +++ b/Zend/tests/fibers/gh20483.phpt @@ -9,8 +9,8 @@ $fiber = new Fiber($callback); try { $fiber->start(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Fiber stack size is too small, it needs to be at least %d bytes +Exception: Fiber stack size is too small, it needs to be at least %d bytes diff --git a/Zend/tests/fibers/negative_stack_size.phpt b/Zend/tests/fibers/negative_stack_size.phpt index 591a8f28878d..c75686b89186 100644 --- a/Zend/tests/fibers/negative_stack_size.phpt +++ b/Zend/tests/fibers/negative_stack_size.phpt @@ -7,7 +7,7 @@ $fiber = new Fiber(function() {}); try { $fiber->start(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE diff --git a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt index dfde978ce06b..cdbc7e443a8a 100644 --- a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt +++ b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt @@ -16,12 +16,12 @@ try { $fiber->start(); })(); } catch (FiberError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "done\n"; ?> --EXPECT-- -Cannot suspend in a force-closed fiber +FiberError: Cannot suspend in a force-closed fiber done diff --git a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt index f1b17caeb5d7..90e4f0c218df 100644 --- a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt +++ b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt @@ -20,7 +20,7 @@ $fiber = new Fiber(function (): void { throw new \Exception("finally exception"); } } catch (Exception $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } finally { echo "outer finally\n"; } @@ -28,7 +28,7 @@ $fiber = new Fiber(function (): void { try { echo Fiber::suspend(); } catch (FiberError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } }); @@ -42,7 +42,7 @@ echo "done\n"; --EXPECT-- fiber inner finally -finally exception +Exception: finally exception outer finally -Cannot suspend in a force-closed fiber +FiberError: Cannot suspend in a force-closed fiber done diff --git a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt index 2916c3dfff86..7eee426439b5 100644 --- a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt +++ b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt @@ -12,7 +12,7 @@ try { function () { } ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -22,12 +22,12 @@ try { class {} ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(!#[Attr(strrev(...))] function () { +AssertionError: assert(!#[Attr(strrev(...))] function () { }) -assert(!new #[Attr(strrev(...))] class { +AssertionError: assert(!new #[Attr(strrev(...))] class { }) diff --git a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt index 97831a8d65f0..f894e8ec7c3e 100644 --- a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt +++ b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt @@ -22,10 +22,10 @@ function foo(Closure $c = Foo::myMethod(...)) { try { foo(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Caught: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait +ErrorException: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait diff --git a/Zend/tests/first_class_callable/first_class_callable_015.phpt b/Zend/tests/first_class_callable/first_class_callable_015.phpt index 72e1d413dd70..f83540f3f28c 100644 --- a/Zend/tests/first_class_callable/first_class_callable_015.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_015.phpt @@ -15,10 +15,10 @@ do_weak_call($fn); try { do_strict_call($fn); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- int(42) -test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d diff --git a/Zend/tests/first_class_callable/first_class_callable_assert.phpt b/Zend/tests/first_class_callable/first_class_callable_assert.phpt index 2bf3d9fc69e2..2888da2447f3 100644 --- a/Zend/tests/first_class_callable/first_class_callable_assert.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_assert.phpt @@ -10,16 +10,16 @@ $assert(1 == 1.0, "Message 1"); try { $assert(1 == 2.0, "Message 2"); } catch (\AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && strlen(...)); } catch (\AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Message 2 -assert(false && strlen(...)) +AssertionError: Message 2 +AssertionError: assert(false && strlen(...)) diff --git a/Zend/tests/first_class_callable/first_class_callable_errors.phpt b/Zend/tests/first_class_callable/first_class_callable_errors.phpt index dffcd779f361..337a13b1e39b 100644 --- a/Zend/tests/first_class_callable/first_class_callable_errors.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_errors.phpt @@ -13,45 +13,45 @@ try { $fn = 123; $fn(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { does_not_exist(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stdClass::doesNotExist(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (new stdClass)->doesNotExist(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { [new stdClass, 'doesNotExist'](...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::privateMethod(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::instanceMethod(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Value of type int is not callable -Call to undefined function does_not_exist() -Call to undefined method stdClass::doesNotExist() -Call to undefined method stdClass::doesNotExist() -Call to undefined method stdClass::doesNotExist() -Call to private method Test::privateMethod() from global scope -Non-static method Test::instanceMethod() cannot be called statically +Error: Value of type int is not callable +Error: Call to undefined function does_not_exist() +Error: Call to undefined method stdClass::doesNotExist() +Error: Call to undefined method stdClass::doesNotExist() +Error: Call to undefined method stdClass::doesNotExist() +Error: Call to private method Test::privateMethod() from global scope +Error: Non-static method Test::instanceMethod() cannot be called statically diff --git a/Zend/tests/foreach/foreach_003.phpt b/Zend/tests/foreach/foreach_003.phpt index 3ecb96de7951..c1678872921b 100644 --- a/Zend/tests/foreach/foreach_003.phpt +++ b/Zend/tests/foreach/foreach_003.phpt @@ -31,7 +31,7 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) { // IS_CV foreach ($obj as $key => $val) echo "$val\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($obj); @@ -39,33 +39,33 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) { // IS_VAR foreach (new IT(3, $trap) as $key => $val) echo "$val\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { // IS_TMP_VAR foreach ((object)new IT(2, $trap) as $key => $val) echo "$val\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -rewind -rewind -rewind -valid -valid -valid -key -key -key -current -current -current +Exception: rewind +Exception: rewind +Exception: rewind +Exception: valid +Exception: valid +Exception: valid +Exception: key +Exception: key +Exception: key +Exception: current +Exception: current +Exception: current 0 -next +Exception: next 0 -next +Exception: next 0 -next +Exception: next diff --git a/Zend/tests/frameless_undefined_var.phpt b/Zend/tests/frameless_undefined_var.phpt index e9c5aac58236..0c40ff38f0c7 100644 --- a/Zend/tests/frameless_undefined_var.phpt +++ b/Zend/tests/frameless_undefined_var.phpt @@ -11,8 +11,8 @@ function test() { try { test(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $foo +Exception: Undefined variable $foo diff --git a/Zend/tests/func_arg_fetch_optimization.phpt b/Zend/tests/func_arg_fetch_optimization.phpt index ba01d8f7dee9..745064e20b07 100644 --- a/Zend/tests/func_arg_fetch_optimization.phpt +++ b/Zend/tests/func_arg_fetch_optimization.phpt @@ -8,8 +8,8 @@ function test($x) { try { test([]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use [] for reading +Error: Cannot use [] for reading diff --git a/Zend/tests/func_get_arg_basic.phpt b/Zend/tests/func_get_arg_basic.phpt index ec06a5c20f4d..afe81eb749b0 100644 --- a/Zend/tests/func_get_arg_basic.phpt +++ b/Zend/tests/func_get_arg_basic.phpt @@ -7,18 +7,18 @@ function test1() { try { var_dump(func_get_arg(-10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -26,12 +26,12 @@ function test2($a) { try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -39,17 +39,17 @@ function test3($a, $b) { try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(func_get_arg(2)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -59,7 +59,7 @@ test2(1); try { test2(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test3(1,2); @@ -67,7 +67,7 @@ call_user_func("test1"); try { call_user_func("test3", 1); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } call_user_func("test3", 1, 2); @@ -76,12 +76,12 @@ class test { try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -90,32 +90,32 @@ test::test1(1); try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 int(10) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function int(1) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected int(1) int(2) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected int(1) int(2) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function int(1) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg() cannot be called from the global scope +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +Error: func_get_arg() cannot be called from the global scope Done diff --git a/Zend/tests/func_get_arg_invalid.phpt b/Zend/tests/func_get_arg_invalid.phpt index 13e0443c07f6..0413356ccabe 100644 --- a/Zend/tests/func_get_arg_invalid.phpt +++ b/Zend/tests/func_get_arg_invalid.phpt @@ -6,7 +6,7 @@ func_get_arg() invalid usage try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } function bar() { @@ -20,10 +20,10 @@ function foo() { try { foo(1,2); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -func_get_arg() cannot be called from the global scope -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +Error: func_get_arg() cannot be called from the global scope +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt index 33cfdb02ebcd..889d56f40561 100644 --- a/Zend/tests/func_get_args.phpt +++ b/Zend/tests/func_get_args.phpt @@ -6,9 +6,9 @@ Testing func_get_args() throws error when called from the global scope try { func_get_args(); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -func_get_args() cannot be called from the global scope +Error: func_get_args() cannot be called from the global scope diff --git a/Zend/tests/func_get_args_basic.phpt b/Zend/tests/func_get_args_basic.phpt index 54ddf1b40c92..3375e49cc693 100644 --- a/Zend/tests/func_get_args_basic.phpt +++ b/Zend/tests/func_get_args_basic.phpt @@ -21,7 +21,7 @@ test2(1); try { test2(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test3(1,2); @@ -29,7 +29,7 @@ call_user_func("test1"); try { call_user_func("test3", 1); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } call_user_func("test3", 1, 2); @@ -44,7 +44,7 @@ test::test1(1); try { var_dump(func_get_args()); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -59,7 +59,7 @@ array(1) { [0]=> int(1) } -Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected array(2) { [0]=> int(1) @@ -68,7 +68,7 @@ array(2) { } array(0) { } -Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected +ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected array(2) { [0]=> int(1) @@ -79,4 +79,4 @@ array(1) { [0]=> int(1) } -func_get_args() cannot be called from the global scope +Error: func_get_args() cannot be called from the global scope diff --git a/Zend/tests/func_num_args_basic.phpt b/Zend/tests/func_num_args_basic.phpt index 0e27b48d6501..afca294bc770 100644 --- a/Zend/tests/func_num_args_basic.phpt +++ b/Zend/tests/func_num_args_basic.phpt @@ -20,7 +20,7 @@ test2(1); try { test2(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test3(1,2); @@ -29,7 +29,7 @@ call_user_func("test1"); try { call_user_func("test3", 1); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } call_user_func("test3", 1, 2); @@ -44,7 +44,7 @@ test::test1(1); try { func_num_args(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -52,11 +52,11 @@ echo "Done\n"; --EXPECTF-- int(0) int(1) -Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected int(2) int(0) -Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected +ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected int(2) int(1) -func_num_args() must be called from a function context +Error: func_num_args() must be called from a function context Done diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt index d23a6a0c7057..1bf9e030bfcc 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt @@ -5,8 +5,8 @@ Call internal function with incorrect number of arguments try { substr("foo"); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -substr() expects at least 2 arguments, 1 given +ArgumentCountError: substr() expects at least 2 arguments, 1 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt index 2b809cdb731a..b8cb6a8ba63a 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt @@ -6,19 +6,15 @@ declare(strict_types=1); try { substr("foo"); } catch (ArgumentCountError $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_diff(); } catch (ArgumentCountError $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ArgumentCountError -substr() expects at least 2 arguments, 1 given -ArgumentCountError -array_diff() expects at least 1 argument, 0 given +ArgumentCountError: substr() expects at least 2 arguments, 1 given +ArgumentCountError: array_diff() expects at least 1 argument, 0 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt index db9be6d85140..20424df0d578 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt @@ -6,16 +6,14 @@ try { function foo($bar) { } foo(); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { function bar($foo, $bar) { } bar(1); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } function bat(int $foo, string $bar) { } @@ -23,23 +21,17 @@ function bat(int $foo, string $bar) { } try { bat(123); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bat("123"); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -ArgumentCountError -Too few arguments to function foo(), 0 passed in %s and exactly 1 expected -ArgumentCountError -Too few arguments to function bar(), 1 passed in %s and exactly 2 expected -ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected -ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected +ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt index 2a67a9ce4c6b..ee29dea6c938 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt @@ -7,16 +7,14 @@ try { function foo($bar) { } foo(); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { function bar($foo, $bar) { } bar(1); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } function bat(int $foo, string $bar) { } @@ -24,32 +22,24 @@ function bat(int $foo, string $bar) { } try { bat(123); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bat("123"); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bat(123, 456); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -ArgumentCountError -Too few arguments to function foo(), 0 passed in %s and exactly 1 expected -ArgumentCountError -Too few arguments to function bar(), 1 passed in %s and exactly 2 expected -ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected -TypeError -bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d -TypeError -bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d +ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected +ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +TypeError: bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d +TypeError: bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d diff --git a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt index 1a6dc97dd2e4..c82a094a70fa 100644 --- a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt +++ b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt @@ -15,7 +15,7 @@ try { test('foo', 'bar', 'baz'); echo 'Not reached'; } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; $testFrame = $e->getTrace()[0]; var_dump($testFrame['function']); var_dump(count($testFrame['args'])); @@ -37,7 +37,7 @@ try { test2('foo', 'variadic1', 'variadic2', 'variadic3'); echo 'Not reached'; } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; $testFrame = $e->getTrace()[0]; var_dump($testFrame['function']); var_dump(count($testFrame['args'])); @@ -53,14 +53,14 @@ try { ?> --EXPECTF-- -Error +Exception: Error string(4) "test" int(3) string(3) "foo" string(3) "bar" string(3) "baz" Success -Error 2 +Exception: Error 2 string(5) "test2" int(4) string(3) "foo"