diff --git a/Zend/tests/034.phpt b/Zend/tests/034.phpt index c608ef96c9b14..d433b3ae8af3a 100644 --- a/Zend/tests/034.phpt +++ b/Zend/tests/034.phpt @@ -23,4 +23,4 @@ switch (1) { ?> --EXPECTF-- -Fatal error: Switch statements may only contain one default clause in %s on line 13 +Fatal error: Switch statements cannot contain more than one default clauses in %s on line %d diff --git a/Zend/tests/036.phpt b/Zend/tests/036.phpt index 8f74bccc075f0..5c1d05531ee65 100644 --- a/Zend/tests/036.phpt +++ b/Zend/tests/036.phpt @@ -11,4 +11,4 @@ try { ?> --EXPECT-- -Illegal offset type +Illegal array key type: Closure diff --git a/Zend/tests/038.phpt b/Zend/tests/038.phpt index e55757bbcd417..49c0175449891 100644 --- a/Zend/tests/038.phpt +++ b/Zend/tests/038.phpt @@ -11,4 +11,4 @@ try { ?> --EXPECT-- -Illegal offset type +Illegal array key type: Closure diff --git a/Zend/tests/assign_coalesce_004.phpt b/Zend/tests/assign_coalesce_004.phpt index 51b9d2ff4be60..4c951098c5fd3 100644 --- a/Zend/tests/assign_coalesce_004.phpt +++ b/Zend/tests/assign_coalesce_004.phpt @@ -8,4 +8,4 @@ foo() ??= 456; ?> --EXPECTF-- -Fatal error: Can't use function return value in write context in %s on line %d +Fatal error: Cannot use function return value in write context in %s on line %d diff --git a/Zend/tests/assign_dim_obj_null_return.phpt b/Zend/tests/assign_dim_obj_null_return.phpt index b046a865137aa..f1288e93d03ce 100644 --- a/Zend/tests/assign_dim_obj_null_return.phpt +++ b/Zend/tests/assign_dim_obj_null_return.phpt @@ -72,12 +72,12 @@ test(); ?> --EXPECT-- Cannot add element to the array as the next element is already occupied -Illegal offset type -Illegal offset type +Illegal array key type: array +Illegal array key type: stdClass Cannot use a scalar value as an array Cannot add element to the array as the next element is already occupied -Illegal offset type -Illegal offset type +Illegal array key type: array +Illegal array key type: stdClass Cannot use a scalar value as an array Attempt to assign property "foo" on bool Attempt to assign property "foo" on bool diff --git a/Zend/tests/attributes/008_wrong_attribution.phpt b/Zend/tests/attributes/008_wrong_attribution.phpt index af61bcf105037..1889cfdb18a0c 100644 --- a/Zend/tests/attributes/008_wrong_attribution.phpt +++ b/Zend/tests/attributes/008_wrong_attribution.phpt @@ -7,4 +7,4 @@ Attributes: Prevent Attribute on non classes function foo() {} ?> --EXPECTF-- -Fatal error: Attribute "Attribute" cannot target function (allowed targets: class) in %s +Fatal error: Attribute Attribute cannot target function (allowed targets: class) in %s on line %d diff --git a/Zend/tests/attributes/020_userland_attribute_validation.phpt b/Zend/tests/attributes/020_userland_attribute_validation.phpt index ce2acb26db161..4ff8a65e6bc71 100644 --- a/Zend/tests/attributes/020_userland_attribute_validation.phpt +++ b/Zend/tests/attributes/020_userland_attribute_validation.phpt @@ -56,7 +56,7 @@ string(2) "A1" bool(true) bool(false) string(7) "ERROR 1" -string(70) "Attribute "A1" cannot target class (allowed targets: function, method)" +string(68) "Attribute A1 cannot target class (allowed targets: function, method)" string(2) "A1" bool(true) diff --git a/Zend/tests/attributes/024_internal_target_validation.phpt b/Zend/tests/attributes/024_internal_target_validation.phpt index e941cf6132ae5..4141fa091045b 100644 --- a/Zend/tests/attributes/024_internal_target_validation.phpt +++ b/Zend/tests/attributes/024_internal_target_validation.phpt @@ -8,4 +8,4 @@ function a1() { } ?> --EXPECTF-- -Fatal error: Attribute "Attribute" cannot target function (allowed targets: class) in %s +Fatal error: Attribute Attribute cannot target function (allowed targets: class) in %s on line %d diff --git a/Zend/tests/attributes/025_internal_repeatable_validation.phpt b/Zend/tests/attributes/025_internal_repeatable_validation.phpt index 671a15fba31f0..eef6a62d85169 100644 --- a/Zend/tests/attributes/025_internal_repeatable_validation.phpt +++ b/Zend/tests/attributes/025_internal_repeatable_validation.phpt @@ -9,4 +9,4 @@ class A1 { } ?> --EXPECTF-- -Fatal error: Attribute "Attribute" must not be repeated in %s +Fatal error: Attribute Attribute cannot be repeated in %s on line %d diff --git a/Zend/tests/break_error_001.phpt b/Zend/tests/break_error_001.phpt index 63c9cc3c8e990..7ca8a1607025a 100644 --- a/Zend/tests/break_error_001.phpt +++ b/Zend/tests/break_error_001.phpt @@ -7,4 +7,4 @@ function foo () { } ?> --EXPECTF-- -Fatal error: 'break' operator accepts only positive integers in %sbreak_error_001.php on line 3 +Fatal error: The break statement accepts only an integer argument greater than or equal to 0 in %s on line %d diff --git a/Zend/tests/break_error_002.phpt b/Zend/tests/break_error_002.phpt index afc889d0fd072..9f7ef2900ec25 100644 --- a/Zend/tests/break_error_002.phpt +++ b/Zend/tests/break_error_002.phpt @@ -7,4 +7,4 @@ function foo () { } ?> --EXPECTF-- -Fatal error: 'break' operator with non-integer operand is no longer supported in %sbreak_error_002.php on line 3 +Fatal error: The break statement with non-integer argument is no longer supported in %s on line %d diff --git a/Zend/tests/break_error_003.phpt b/Zend/tests/break_error_003.phpt index 44a0e849ff2a8..91c5f609d6d3a 100644 --- a/Zend/tests/break_error_003.phpt +++ b/Zend/tests/break_error_003.phpt @@ -7,4 +7,4 @@ function foo () { } ?> --EXPECTF-- -Fatal error: 'break' not in the 'loop' or 'switch' context in %sbreak_error_003.php on line 3 +Fatal error: The break statement can only be used inside a loop or a switch in %s on line %d diff --git a/Zend/tests/break_error_004.phpt b/Zend/tests/break_error_004.phpt index e82d96f727912..e07fe52f01ebe 100644 --- a/Zend/tests/break_error_004.phpt +++ b/Zend/tests/break_error_004.phpt @@ -9,4 +9,4 @@ function foo () { } ?> --EXPECTF-- -Fatal error: Cannot 'break' 2 levels in %sbreak_error_004.php on line 4 +Fatal error: Cannot break 2 levels in %s on line %d diff --git a/Zend/tests/bug42859.phpt b/Zend/tests/bug42859.phpt index 755f41f8d62b9..73447c0b835a4 100644 --- a/Zend/tests/bug42859.phpt +++ b/Zend/tests/bug42859.phpt @@ -9,4 +9,4 @@ use Blah\Exception; use Blah\Ex; ?> --EXPECTF-- -Fatal error: Cannot use Blah\Ex as Ex because the name is already in use in %sbug42859.php on line 6 +Fatal error: Cannot import class Blah\Ex as Ex, Ex has already been declared in %s on line %d diff --git a/Zend/tests/bug43332_2.phpt b/Zend/tests/bug43332_2.phpt index 604479e60660c..2c93280de4a7a 100644 --- a/Zend/tests/bug43332_2.phpt +++ b/Zend/tests/bug43332_2.phpt @@ -13,4 +13,4 @@ $foo->bar($foo); // Ok! $foo->bar(new stdclass); // Error, ok! ?> --EXPECTF-- -Fatal error: '\self' is an invalid class name in %sbug43332_2.php on line 5 +Fatal error: Class name "\self" is invalid in %s on line %d diff --git a/Zend/tests/bug69092.2.phpt b/Zend/tests/bug69092.2.phpt index f774820056d19..8368849c9fbee 100644 --- a/Zend/tests/bug69092.2.phpt +++ b/Zend/tests/bug69092.2.phpt @@ -13,6 +13,6 @@ function foo() { echo "Bye" ?> --EXPECTF-- -Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in %s on line %d +Warning: declare(encoding=...) is ignored, because Zend multibyte feature is turned off by settings in %s on line %d Fatal error: Encoding declaration pragma must be the very first statement in the script in %s on line %d diff --git a/Zend/tests/bug69388.phpt b/Zend/tests/bug69388.phpt index c874db715dea2..1fac2be0ab51a 100644 --- a/Zend/tests/bug69388.phpt +++ b/Zend/tests/bug69388.phpt @@ -15,4 +15,4 @@ eval('namespace {use Exception;}'); ?> --EXPECT-- -The use statement with non-compound name 'Exception' has no effect +Importing the global symbol Exception has no effect in the global scope diff --git a/Zend/tests/bug69388_2.phpt b/Zend/tests/bug69388_2.phpt index 40b14e02577f7..e5c16dedbb4e1 100644 --- a/Zend/tests/bug69388_2.phpt +++ b/Zend/tests/bug69388_2.phpt @@ -12,4 +12,4 @@ eval('namespace {use Exception;}'); ?> --EXPECT-- -The use statement with non-compound name 'Exception' has no effect +Importing the global symbol Exception has no effect in the global scope diff --git a/Zend/tests/bug69805.phpt b/Zend/tests/bug69805.phpt index c3ca62dc11cfb..0cbe833d34b22 100644 --- a/Zend/tests/bug69805.phpt +++ b/Zend/tests/bug69805.phpt @@ -5,4 +5,4 @@ Bug #69805 (null ptr deref and seg fault in zend_resolve_class_name) class p{public function c(){(0)::t;}}?> ?> --EXPECTF-- -Fatal error: Illegal class name in %sbug69805.php on line %d +Fatal error: Class name must be a string in %s on line %d diff --git a/Zend/tests/bug70240.phpt b/Zend/tests/bug70240.phpt index d2aae2137d22d..a38de6eddfd0d 100644 --- a/Zend/tests/bug70240.phpt +++ b/Zend/tests/bug70240.phpt @@ -5,4 +5,4 @@ Bug #70240 (Segfault when doing unset($var())) unset($var()); ?> --EXPECTF-- -Fatal error: Can't use function return value in write context in %sbug70240.php on line %d +Fatal error: Cannot use function return value in write context in %s on line %d diff --git a/Zend/tests/bug71871.phpt b/Zend/tests/bug71871.phpt index 1781ff07aa8bf..750e24b09288a 100644 --- a/Zend/tests/bug71871.phpt +++ b/Zend/tests/bug71871.phpt @@ -9,4 +9,4 @@ interface test { ?> --EXPECTF-- -Fatal error: Access type for interface method test::test() must be omitted in %s on line %d +Fatal error: Interface method test::test() cannot be final in %s on line %d diff --git a/Zend/tests/bug71871_2.phpt b/Zend/tests/bug71871_2.phpt index 6a9404ea37d9e..fa443692dfffe 100644 --- a/Zend/tests/bug71871_2.phpt +++ b/Zend/tests/bug71871_2.phpt @@ -9,4 +9,4 @@ interface test { ?> --EXPECTF-- -Fatal error: Access type for interface method test::test() must be omitted in %s on line %d +Fatal error: Interface method test::test() cannot be abstract in %s on line %d diff --git a/Zend/tests/bug72441.phpt b/Zend/tests/bug72441.phpt index 8e0a12a1c5286..7becfbfde1a66 100644 --- a/Zend/tests/bug72441.phpt +++ b/Zend/tests/bug72441.phpt @@ -11,4 +11,4 @@ list( ) = $array; ?> --EXPECTF-- -Fatal error: Cannot mix keyed and unkeyed array entries in assignments in %sbug72441.php on line %d +Fatal error: Cannot mix array elements with and without keys in assignments in %s on line %d diff --git a/Zend/tests/bug77660.phpt b/Zend/tests/bug77660.phpt index 94af1f9e2c526..3edf2c5a5f3a1 100644 --- a/Zend/tests/bug77660.phpt +++ b/Zend/tests/bug77660.phpt @@ -7,4 +7,4 @@ Bug #77660 (Segmentation fault on break 2147483648) for(;;) break 2147483648; ?> --EXPECTF-- -Fatal error: Cannot 'break' 2147483648 levels in %sbug77660.php on line %d +Fatal error: Cannot break 2147483648 levels in %s on line %d diff --git a/Zend/tests/bug79790.phpt b/Zend/tests/bug79790.phpt index 4fce25291bcb5..d43930767bd75 100644 --- a/Zend/tests/bug79790.phpt +++ b/Zend/tests/bug79790.phpt @@ -8,7 +8,7 @@ function b($a = array()[array ()]) { } ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Illegal offset type in %s:%d +Fatal error: Uncaught TypeError: Illegal array key type: array in %s:%d Stack trace: #0 %s(%d): b() #1 {main} diff --git a/Zend/tests/bug79947.phpt b/Zend/tests/bug79947.phpt index 906f58144b41d..a12e9578af3b1 100644 --- a/Zend/tests/bug79947.phpt +++ b/Zend/tests/bug79947.phpt @@ -12,6 +12,6 @@ try { var_dump($array); ?> --EXPECT-- -Illegal offset type +Illegal array key type: array array(0) { } diff --git a/Zend/tests/call_user_func_005.phpt b/Zend/tests/call_user_func_005.phpt index 2f5220db6291b..76fbeb5ee0f64 100644 --- a/Zend/tests/call_user_func_005.phpt +++ b/Zend/tests/call_user_func_005.phpt @@ -18,7 +18,7 @@ var_dump(call_user_func(array('foo', 'teste'))); ?> --EXPECTF-- -Deprecated: Required parameter $b follows optional parameter $a in %s on line %d +Deprecated: Required parameter $b should precede optional parameter $a in %s on line %d string(1) "x" array(1) { [0]=> diff --git a/Zend/tests/catch_static.phpt b/Zend/tests/catch_static.phpt index 283aef9181edf..edb3218ea72fb 100644 --- a/Zend/tests/catch_static.phpt +++ b/Zend/tests/catch_static.phpt @@ -14,4 +14,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Bad class name in the catch statement in %s on line %d +Fatal error: Illegal class name in the catch statement in %s on line %d diff --git a/Zend/tests/class_name_as_scalar_error_002.phpt b/Zend/tests/class_name_as_scalar_error_002.phpt index ebb2dd4c27122..c67c59c2f81d3 100644 --- a/Zend/tests/class_name_as_scalar_error_002.phpt +++ b/Zend/tests/class_name_as_scalar_error_002.phpt @@ -11,4 +11,4 @@ namespace Foo\Bar { } ?> --EXPECTF-- -Fatal error: Cannot use "parent" when current class scope has no parent in %s on line %d +Fatal error: "parent" must be used only in a class scope with a parent class in %s on line %d diff --git a/Zend/tests/class_on_constant_evaluated_expression.phpt b/Zend/tests/class_on_constant_evaluated_expression.phpt index c70262c20d7bb..59e3e47b2c089 100644 --- a/Zend/tests/class_on_constant_evaluated_expression.phpt +++ b/Zend/tests/class_on_constant_evaluated_expression.phpt @@ -7,4 +7,4 @@ An error should be generated when using ::class on a constant evaluated expressi ?> --EXPECTF-- -Fatal error: Cannot use "::class" on value of type int in %s on line %d +Fatal error: Cannot use "::class" on a value of type int in %s on line %d diff --git a/Zend/tests/class_uses_static.phpt b/Zend/tests/class_uses_static.phpt index df34e5b6af4b7..37fa76b0f0f53 100644 --- a/Zend/tests/class_uses_static.phpt +++ b/Zend/tests/class_uses_static.phpt @@ -9,4 +9,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot use 'static' as trait name, as it is reserved in %s on line %d +Fatal error: Cannot use "static" as trait name, static is a reserved class name in %s on line %d diff --git a/Zend/tests/constant_expressions_invalid_offset_type_error.phpt b/Zend/tests/constant_expressions_invalid_offset_type_error.phpt index 649c3a325a0c2..4fbe746c2d662 100644 --- a/Zend/tests/constant_expressions_invalid_offset_type_error.phpt +++ b/Zend/tests/constant_expressions_invalid_offset_type_error.phpt @@ -8,7 +8,7 @@ const C2 = [C1, [] => 1]; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Illegal offset type in %s:%d +Fatal error: Uncaught TypeError: Illegal array key type: array in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/ctor_promotion_free_function.phpt b/Zend/tests/ctor_promotion_free_function.phpt index 1eb84c5517797..bb8f9814fde33 100644 --- a/Zend/tests/ctor_promotion_free_function.phpt +++ b/Zend/tests/ctor_promotion_free_function.phpt @@ -7,4 +7,4 @@ function __construct(public $prop) {} ?> --EXPECTF-- -Fatal error: Cannot declare promoted property outside a constructor in %s on line %d +Fatal error: __construct(): Promoted property $prop must be declared inside a constructor in %s on line %d diff --git a/Zend/tests/ctor_promotion_not_a_ctor.phpt b/Zend/tests/ctor_promotion_not_a_ctor.phpt index 110ee8a5ce756..d121d101a93cf 100644 --- a/Zend/tests/ctor_promotion_not_a_ctor.phpt +++ b/Zend/tests/ctor_promotion_not_a_ctor.phpt @@ -9,4 +9,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot declare promoted property outside a constructor in %s on line %d +Fatal error: Test::foobar(): Promoted property $x must be declared inside a constructor in %s on line %d diff --git a/Zend/tests/declare_003.phpt b/Zend/tests/declare_003.phpt index 2f3e88738031b..ad3d311192ab9 100644 --- a/Zend/tests/declare_003.phpt +++ b/Zend/tests/declare_003.phpt @@ -14,8 +14,8 @@ print 'DONE'; ?> --EXPECTF-- -Warning: Unsupported encoding [1] in %sdeclare_003.php on line %d +Warning: Unsupported encoding 1 in %s on line %d -Warning: Unsupported encoding [11111111111111] in %sdeclare_003.php on line %d +Warning: Unsupported encoding 11111111111111 in %s on line %d Fatal error: Encoding must be a literal in %s on line %d diff --git a/Zend/tests/declare_004.phpt b/Zend/tests/declare_004.phpt index d823c9a95021c..29aeebb655078 100644 --- a/Zend/tests/declare_004.phpt +++ b/Zend/tests/declare_004.phpt @@ -13,8 +13,8 @@ print 'DONE'; ?> --EXPECTF-- -Warning: Unsupported encoding [%d] in %sdeclare_004.php on line 3 +Warning: Unsupported encoding 1 in %s on line %d -Warning: Unsupported encoding [%f] in %sdeclare_004.php on line 4 +Warning: Unsupported encoding 1123131232131312321 in %s on line %d Fatal error: Encoding must be a literal in %sdeclare_004.php on line 5 diff --git a/Zend/tests/declare_already_in_use.phpt b/Zend/tests/declare_already_in_use.phpt index c7e4ce8d677b7..839ef0efc9377 100644 --- a/Zend/tests/declare_already_in_use.phpt +++ b/Zend/tests/declare_already_in_use.phpt @@ -11,4 +11,4 @@ test(); ?> --EXPECTF-- -Fatal error: Cannot declare class A, because the name is already in use in %s on line %d +Fatal error: class A has already been declared in %s on line %d diff --git a/Zend/tests/duplicate_label_error.phpt b/Zend/tests/duplicate_label_error.phpt index c89d7a69913ca..58cafa5f54299 100644 --- a/Zend/tests/duplicate_label_error.phpt +++ b/Zend/tests/duplicate_label_error.phpt @@ -9,4 +9,4 @@ goto foo; ?> --EXPECTF-- -Fatal error: Label 'foo' already defined in %s on line %d +Fatal error: Label foo has already been defined in %s on line %d diff --git a/Zend/tests/errmsg_001.phpt b/Zend/tests/errmsg_001.phpt index e629f19c40556..81b3d989a55f3 100644 --- a/Zend/tests/errmsg_001.phpt +++ b/Zend/tests/errmsg_001.phpt @@ -13,4 +13,4 @@ class Impl extends Test { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Non-abstract method Impl::Foo() must contain body in %s on line %d +Fatal error: Non-abstract method Impl::Foo() must have body in %s on line %d diff --git a/Zend/tests/errmsg_002.phpt b/Zend/tests/errmsg_002.phpt index b00a850fade6e..ee607e9e32c5a 100644 --- a/Zend/tests/errmsg_002.phpt +++ b/Zend/tests/errmsg_002.phpt @@ -11,4 +11,4 @@ abstract class test { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Abstract function test::foo() cannot be declared private in %s on line %d +Fatal error: Abstract method test::foo() must have public or protected visibility in %s on line %d diff --git a/Zend/tests/errmsg_004.phpt b/Zend/tests/errmsg_004.phpt index 7e71b41087a81..1068e99d3bde8 100644 --- a/Zend/tests/errmsg_004.phpt +++ b/Zend/tests/errmsg_004.phpt @@ -12,4 +12,4 @@ foo() = 1; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Can't use function return value in write context in %s on line %d +Fatal error: Cannot use function return value in write context in %s on line %d diff --git a/Zend/tests/errmsg_005.phpt b/Zend/tests/errmsg_005.phpt index 6089a771f4c6b..88fc8c9a12517 100644 --- a/Zend/tests/errmsg_005.phpt +++ b/Zend/tests/errmsg_005.phpt @@ -15,4 +15,4 @@ $t->foo() = 1; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Can't use method return value in write context in %s on line %d +Fatal error: Cannot use method return value in write context in %s on line %d diff --git a/Zend/tests/errmsg_011.phpt b/Zend/tests/errmsg_011.phpt index ac29c6e0810fc..418f7867fa5a8 100644 --- a/Zend/tests/errmsg_011.phpt +++ b/Zend/tests/errmsg_011.phpt @@ -13,4 +13,4 @@ class test { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot redeclare test::foo() in %s on line %d +Fatal error: Method test::foo() has already been declared in %s on line %d diff --git a/Zend/tests/errmsg_026.phpt b/Zend/tests/errmsg_026.phpt index 2144a0707b231..3f726a8fe09b6 100644 --- a/Zend/tests/errmsg_026.phpt +++ b/Zend/tests/errmsg_026.phpt @@ -9,4 +9,4 @@ class stdclass { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot declare class stdclass, because the name is already in use in %s on line %d +Fatal error: class stdclass has already been declared in %s on line %d diff --git a/Zend/tests/errmsg_028.phpt b/Zend/tests/errmsg_028.phpt index 12fd36384fb2f..36923107e07fc 100644 --- a/Zend/tests/errmsg_028.phpt +++ b/Zend/tests/errmsg_028.phpt @@ -9,4 +9,4 @@ class self { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d +Fatal error: Class "self" cannot be declared, self is a reserved class name in %s on line %d diff --git a/Zend/tests/errmsg_029.phpt b/Zend/tests/errmsg_029.phpt index e40cb2dc68240..6f44868940aeb 100644 --- a/Zend/tests/errmsg_029.phpt +++ b/Zend/tests/errmsg_029.phpt @@ -9,4 +9,4 @@ class parent { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot use 'parent' as class name as it is reserved in %s on line %d +Fatal error: Class "parent" cannot be declared, parent is a reserved class name in %s on line %d diff --git a/Zend/tests/errmsg_030.phpt b/Zend/tests/errmsg_030.phpt index 589965cf08c03..6506e4d8a3ced 100644 --- a/Zend/tests/errmsg_030.phpt +++ b/Zend/tests/errmsg_030.phpt @@ -9,4 +9,4 @@ class test extends self { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot use 'self' as class name, as it is reserved in %s on line %d +Fatal error: Cannot use "self" as class name, self is a reserved class name in %s on line %d diff --git a/Zend/tests/errmsg_031.phpt b/Zend/tests/errmsg_031.phpt index ed1d0bec2d763..7c2fd8fcd2923 100644 --- a/Zend/tests/errmsg_031.phpt +++ b/Zend/tests/errmsg_031.phpt @@ -9,4 +9,4 @@ class test extends parent { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot use 'parent' as class name, as it is reserved in %s on line %d +Fatal error: Cannot use "parent" as class name, parent is a reserved class name in %s on line %d diff --git a/Zend/tests/errmsg_035.phpt b/Zend/tests/errmsg_035.phpt index 140e3e9cf47f9..2a1af0df7a644 100644 --- a/Zend/tests/errmsg_035.phpt +++ b/Zend/tests/errmsg_035.phpt @@ -9,4 +9,4 @@ class test implements self { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot use 'self' as interface name, as it is reserved in %s on line %d +Fatal error: Cannot use "self" as interface name, self is a reserved class name in %s on line %d diff --git a/Zend/tests/errmsg_036.phpt b/Zend/tests/errmsg_036.phpt index 33c6bca1d6a74..033f81b849570 100644 --- a/Zend/tests/errmsg_036.phpt +++ b/Zend/tests/errmsg_036.phpt @@ -9,4 +9,4 @@ class test implements parent { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot use 'parent' as interface name, as it is reserved in %s on line %d +Fatal error: Cannot use "parent" as interface name, parent is a reserved class name in %s on line %d diff --git a/Zend/tests/errmsg_037.phpt b/Zend/tests/errmsg_037.phpt index f15fea89f3b7c..f65f4ae8143f0 100644 --- a/Zend/tests/errmsg_037.phpt +++ b/Zend/tests/errmsg_037.phpt @@ -10,4 +10,4 @@ class test { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Properties cannot be declared abstract in %s on line %d +Fatal error: Class test cannot declare properties as abstract in %s on line %d diff --git a/Zend/tests/errmsg_038.phpt b/Zend/tests/errmsg_038.phpt index d5ae50ded0f92..a30110af23746 100644 --- a/Zend/tests/errmsg_038.phpt +++ b/Zend/tests/errmsg_038.phpt @@ -10,4 +10,4 @@ class test { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot declare property test::$var final, the final modifier is allowed only for methods and classes in %s on line %d +Fatal error: Property test::$var cannot be declared final, the final modifier is allowed only for methods and classes in %s on line %d diff --git a/Zend/tests/errmsg_039.phpt b/Zend/tests/errmsg_039.phpt index cc07106f5e55d..dffbb1c8993ac 100644 --- a/Zend/tests/errmsg_039.phpt +++ b/Zend/tests/errmsg_039.phpt @@ -11,4 +11,4 @@ class test { echo "Done\n"; ?> --EXPECTF-- -Fatal error: Cannot redeclare test::$var in %s on line %d +Fatal error: Property test::$var has already been declared in %s on line %d diff --git a/Zend/tests/function_redecl.phpt b/Zend/tests/function_redecl.phpt index 4c1395472fc6a..7740acb8a84f1 100644 --- a/Zend/tests/function_redecl.phpt +++ b/Zend/tests/function_redecl.phpt @@ -6,4 +6,4 @@ function f() {} function f() {} ?> --EXPECTF-- -Fatal error: Cannot redeclare f() (previously declared in %s:%d) in %s on line %d +Fatal error: Function f() has already been declared (previous declaration in %s on line %d diff --git a/Zend/tests/generators/errors/yield_outside_function_error.phpt b/Zend/tests/generators/errors/yield_outside_function_error.phpt index f999c1c03bf48..e2926a1e09c77 100644 --- a/Zend/tests/generators/errors/yield_outside_function_error.phpt +++ b/Zend/tests/generators/errors/yield_outside_function_error.phpt @@ -7,4 +7,4 @@ yield "Test"; ?> --EXPECTF-- -Fatal error: The "yield" expression can only be used inside a function in %s on line %d +Fatal error: The "yield" statement can only be used inside a function in %s on line %d diff --git a/Zend/tests/increment_function_return_error.phpt b/Zend/tests/increment_function_return_error.phpt index 329cc83b777d2..b91381c92e634 100644 --- a/Zend/tests/increment_function_return_error.phpt +++ b/Zend/tests/increment_function_return_error.phpt @@ -11,4 +11,4 @@ function test() { ?> --EXPECTF-- -Fatal error: Can't use function return value in write context in %s on line %d +Fatal error: Cannot use function return value in write context in %s on line %d diff --git a/Zend/tests/inter_06.phpt b/Zend/tests/inter_06.phpt index aba8ba4fb4976..79d937c92fff2 100644 --- a/Zend/tests/inter_06.phpt +++ b/Zend/tests/inter_06.phpt @@ -7,4 +7,4 @@ interface stdClass { } ?> --EXPECTF-- -Fatal error: Cannot declare interface stdClass, because the name is already in use in %s on line %d +Fatal error: interface stdClass has already been declared in %s on line %d diff --git a/Zend/tests/interface_extends_static.phpt b/Zend/tests/interface_extends_static.phpt index 3d12070ec8d07..42da90d458fef 100644 --- a/Zend/tests/interface_extends_static.phpt +++ b/Zend/tests/interface_extends_static.phpt @@ -7,4 +7,4 @@ interface Foo extends static {} ?> --EXPECTF-- -Fatal error: Cannot use 'static' as interface name, as it is reserved in %s on line %d +Fatal error: Cannot use "static" as interface name, static is a reserved class name in %s on line %d diff --git a/Zend/tests/isset_expr_error.phpt b/Zend/tests/isset_expr_error.phpt index 27fc6cd8d3772..4f4b8d011e5b6 100644 --- a/Zend/tests/isset_expr_error.phpt +++ b/Zend/tests/isset_expr_error.phpt @@ -5,4 +5,4 @@ Error message for isset(func()) isset(1 + 1); ?> --EXPECTF-- -Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in %s on line %d +Fatal error: Cannot use isset() on the result of an expression (you can use "expression !== null" instead) in %s on line %d diff --git a/Zend/tests/isset_func_error.phpt b/Zend/tests/isset_func_error.phpt index 7d6616b96d416..48eda872403a5 100644 --- a/Zend/tests/isset_func_error.phpt +++ b/Zend/tests/isset_func_error.phpt @@ -5,4 +5,4 @@ Error message for isset(func()) isset(abc()); ?> --EXPECTF-- -Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in %s on line %d +Fatal error: Cannot use isset() on the result of an expression (you can use "expression !== null" instead) in %s on line %d diff --git a/Zend/tests/jump06.phpt b/Zend/tests/jump06.phpt index ef01b0e5b3a88..f34ee8eb803c8 100644 --- a/Zend/tests/jump06.phpt +++ b/Zend/tests/jump06.phpt @@ -5,4 +5,4 @@ jump 06: goto to undefined label goto L1; ?> --EXPECTF-- -Fatal error: 'goto' to undefined label 'L1' in %sjump06.php on line 2 +Fatal error: goto to undefined label L1 in %s on line %d diff --git a/Zend/tests/jump07.phpt b/Zend/tests/jump07.phpt index 6015b91a53706..f6998fc434ef3 100644 --- a/Zend/tests/jump07.phpt +++ b/Zend/tests/jump07.phpt @@ -8,4 +8,4 @@ while (0) { goto L1; ?> --EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump07.php on line 5 +Fatal error: goto into loop or switch statement is disallowed in %s on line %d diff --git a/Zend/tests/jump08.phpt b/Zend/tests/jump08.phpt index e2f7cd4bc6d37..1c0d68a0df3b7 100644 --- a/Zend/tests/jump08.phpt +++ b/Zend/tests/jump08.phpt @@ -8,4 +8,4 @@ while (0) { } ?> --EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump08.php on line 2 +Fatal error: goto into loop or switch statement is disallowed in %s on line %d diff --git a/Zend/tests/jump09.phpt b/Zend/tests/jump09.phpt index 1d3420fddb209..dbc12acff651c 100644 --- a/Zend/tests/jump09.phpt +++ b/Zend/tests/jump09.phpt @@ -10,4 +10,4 @@ switch (0) { goto L1; ?> --EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump09.php on line 7 +Fatal error: goto into loop or switch statement is disallowed in %s on line %d diff --git a/Zend/tests/jump10.phpt b/Zend/tests/jump10.phpt index e69c508d6ad81..afb3dfa3890ec 100644 --- a/Zend/tests/jump10.phpt +++ b/Zend/tests/jump10.phpt @@ -10,4 +10,4 @@ switch (0) { } ?> --EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump10.php on line 2 +Fatal error: goto into loop or switch statement is disallowed in %s on line %d diff --git a/Zend/tests/list/list_reference_010.phpt b/Zend/tests/list/list_reference_010.phpt index 8ceb344a33b7a..41e446b41ffaf 100644 --- a/Zend/tests/list/list_reference_010.phpt +++ b/Zend/tests/list/list_reference_010.phpt @@ -5,4 +5,4 @@ list(&$foo) = [42]; ?> --EXPECTF-- -Fatal error: Cannot assign reference to non referencable value in %s on line %d +Fatal error: Cannot assign reference to non-referencable value in %s on line %d diff --git a/Zend/tests/list/list_reference_011.phpt b/Zend/tests/list/list_reference_011.phpt index 405f34f22737e..45a6d1d5d854f 100644 --- a/Zend/tests/list/list_reference_011.phpt +++ b/Zend/tests/list/list_reference_011.phpt @@ -6,4 +6,4 @@ const FOO = 10; [&$f] = FOO; ?> --EXPECTF-- -Fatal error: Cannot assign reference to non referencable value in %s on line %d +Fatal error: Cannot assign reference to non-referencable value in %s on line %d diff --git a/Zend/tests/list_mixed_keyed_unkeyed.phpt b/Zend/tests/list_mixed_keyed_unkeyed.phpt index 245d20f31fb93..dfd236b5419d9 100644 --- a/Zend/tests/list_mixed_keyed_unkeyed.phpt +++ b/Zend/tests/list_mixed_keyed_unkeyed.phpt @@ -13,4 +13,4 @@ list($zero, 1 => $one, "foo" => $foo) = $contrivedKeyedAndUnkeyedArrayExample; ?> --EXPECTF-- -Fatal error: Cannot mix keyed and unkeyed array entries in assignments in %s on line %d +Fatal error: Cannot mix array elements with and without keys in assignments in %s on line %d diff --git a/Zend/tests/lsb_006.phpt b/Zend/tests/lsb_006.phpt index 9d1600d425ae1..1fb755f6d8ade 100644 --- a/Zend/tests/lsb_006.phpt +++ b/Zend/tests/lsb_006.phpt @@ -9,4 +9,4 @@ class Foo extends static { ?> ==DONE== --EXPECTF-- -Fatal error: Cannot use 'static' as class name, as it is reserved in %s on line %d +Fatal error: Cannot use "static" as class name, static is a reserved class name in %s on line %d diff --git a/Zend/tests/lsb_007.phpt b/Zend/tests/lsb_007.phpt index 970044eab29e9..17e9e21f0a7ac 100644 --- a/Zend/tests/lsb_007.phpt +++ b/Zend/tests/lsb_007.phpt @@ -9,4 +9,4 @@ class Foo implements static { ?> ==DONE== --EXPECTF-- -Fatal error: Cannot use 'static' as interface name, as it is reserved in %s on line %d +Fatal error: Cannot use "static" as interface name, static is a reserved class name in %s on line %d diff --git a/Zend/tests/match/038.phpt b/Zend/tests/match/038.phpt index cc158038a9b19..f4078a1a470c4 100644 --- a/Zend/tests/match/038.phpt +++ b/Zend/tests/match/038.phpt @@ -12,4 +12,4 @@ match (1) { ?> --EXPECTF-- -Fatal error: Match expressions may only contain one default arm in %s on line 7 +Fatal error: Match expressions cannot contain more than one default arms in %s on line %d diff --git a/Zend/tests/name_collision_01.phpt b/Zend/tests/name_collision_01.phpt index d6d4ae35db1e6..b12e1574830ed 100644 --- a/Zend/tests/name_collision_01.phpt +++ b/Zend/tests/name_collision_01.phpt @@ -8,4 +8,4 @@ class A { } ?> --EXPECTF-- -Fatal error: Cannot declare class A, because the name is already in use in %s on line %d +Fatal error: class A has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_02.phpt b/Zend/tests/name_collision_02.phpt index 3baeb45e6f8fe..3d0c032722b5f 100644 --- a/Zend/tests/name_collision_02.phpt +++ b/Zend/tests/name_collision_02.phpt @@ -8,4 +8,4 @@ interface A { } ?> --EXPECTF-- -Fatal error: Cannot declare interface A, because the name is already in use in %s on line %d +Fatal error: interface A has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_03.phpt b/Zend/tests/name_collision_03.phpt index 6be45204a55b2..492cf951bbb0c 100644 --- a/Zend/tests/name_collision_03.phpt +++ b/Zend/tests/name_collision_03.phpt @@ -8,4 +8,4 @@ trait A { } ?> --EXPECTF-- -Fatal error: Cannot declare trait A, because the name is already in use in %s on line %d +Fatal error: trait A has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_04.phpt b/Zend/tests/name_collision_04.phpt index b391a96744342..5a368c3765efd 100644 --- a/Zend/tests/name_collision_04.phpt +++ b/Zend/tests/name_collision_04.phpt @@ -8,4 +8,4 @@ interface A { } ?> --EXPECTF-- -Fatal error: Cannot declare interface A, because the name is already in use in %s on line %d +Fatal error: interface A has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_05.phpt b/Zend/tests/name_collision_05.phpt index 87af1f0df9941..e16f71eaf3654 100644 --- a/Zend/tests/name_collision_05.phpt +++ b/Zend/tests/name_collision_05.phpt @@ -8,4 +8,4 @@ trait A { } ?> --EXPECTF-- -Fatal error: Cannot declare trait A, because the name is already in use in %s on line %d +Fatal error: trait A has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_06.phpt b/Zend/tests/name_collision_06.phpt index cfeeed4a4340b..e281814ea455a 100644 --- a/Zend/tests/name_collision_06.phpt +++ b/Zend/tests/name_collision_06.phpt @@ -8,4 +8,4 @@ trait A { } ?> --EXPECTF-- -Fatal error: Cannot declare trait A, because the name is already in use in %s on line %d +Fatal error: trait A has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_07.phpt b/Zend/tests/name_collision_07.phpt index cb35e88db69cf..5033754fb604e 100644 --- a/Zend/tests/name_collision_07.phpt +++ b/Zend/tests/name_collision_07.phpt @@ -13,4 +13,4 @@ namespace Bazzle { } ?> --EXPECTF-- -Fatal error: Cannot declare class Bazzle\Bar because the name is already in use in %s on line %d +Fatal error: Class Bazzle\Bar has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_08.phpt b/Zend/tests/name_collision_08.phpt index 652fa3dbf15ed..5c705af1a7a37 100644 --- a/Zend/tests/name_collision_08.phpt +++ b/Zend/tests/name_collision_08.phpt @@ -13,4 +13,4 @@ namespace Bazzle { } ?> --EXPECTF-- -Fatal error: Cannot declare function Bazzle\bar because the name is already in use in %s on line %d +Fatal error: Function Bazzle\bar() has already been declared in %s on line %d diff --git a/Zend/tests/name_collision_09.phpt b/Zend/tests/name_collision_09.phpt index 88d4d55fc89bf..68e1725609839 100644 --- a/Zend/tests/name_collision_09.phpt +++ b/Zend/tests/name_collision_09.phpt @@ -13,4 +13,4 @@ namespace Bazzle { } ?> --EXPECTF-- -Fatal error: Cannot declare const Bazzle\BAR because the name is already in use in %s on line %d +Fatal error: Constant Bazzle\BAR has already been declared in %s on line %d diff --git a/Zend/tests/named_params/attributes_named_flags.phpt b/Zend/tests/named_params/attributes_named_flags.phpt index fcb08755e3767..36c3c64104f2f 100644 --- a/Zend/tests/named_params/attributes_named_flags.phpt +++ b/Zend/tests/named_params/attributes_named_flags.phpt @@ -14,7 +14,7 @@ function test() {} ?> --EXPECTF-- -Fatal error: Uncaught Error: Attribute "MyAttribute" cannot target function (allowed targets: class) in %s:%d +Fatal error: Uncaught Error: Attribute MyAttribute cannot target function (allowed targets: class) in %s:%d Stack trace: #0 %s(%d): ReflectionAttribute->newInstance() #1 {main} diff --git a/Zend/tests/named_params/attributes_named_flags_incorrect.phpt b/Zend/tests/named_params/attributes_named_flags_incorrect.phpt index 2ad231602f5f1..b006eccc6d680 100644 --- a/Zend/tests/named_params/attributes_named_flags_incorrect.phpt +++ b/Zend/tests/named_params/attributes_named_flags_incorrect.phpt @@ -15,7 +15,7 @@ function test() {} ?> --EXPECTF-- -Fatal error: Uncaught Error: Attribute "MyAttribute" cannot target function (allowed targets: class) in %s:%d +Fatal error: Uncaught Error: Attribute MyAttribute cannot target function (allowed targets: class) in %s:%d Stack trace: #0 %s(%d): ReflectionAttribute->newInstance() #1 {main} diff --git a/Zend/tests/namespace_name_namespace.phpt b/Zend/tests/namespace_name_namespace.phpt index 311705ab2e2e1..ef0b0ddfa06a2 100644 --- a/Zend/tests/namespace_name_namespace.phpt +++ b/Zend/tests/namespace_name_namespace.phpt @@ -7,4 +7,4 @@ namespace NAMEspace; ?> --EXPECTF-- -Fatal error: Cannot use 'NAMEspace' as namespace name in %s on line %d +Fatal error: Cannot use "NAMEspace" as namespace name in %s on line %d diff --git a/Zend/tests/ns_029.phpt b/Zend/tests/ns_029.phpt index d053a9a33724a..1154dcb35239c 100644 --- a/Zend/tests/ns_029.phpt +++ b/Zend/tests/ns_029.phpt @@ -10,4 +10,4 @@ class Foo { new Foo(); ?> --EXPECTF-- -Fatal error: Cannot declare class Foo because the name is already in use in %sns_029.php on line 4 +Fatal error: Class Foo has already been declared in %s on line %d diff --git a/Zend/tests/ns_030.phpt b/Zend/tests/ns_030.phpt index d275bc23cc1db..ab8a22a43eeaf 100644 --- a/Zend/tests/ns_030.phpt +++ b/Zend/tests/ns_030.phpt @@ -10,4 +10,4 @@ use A\B as Foo; new Foo(); ?> --EXPECTF-- -Fatal error: Cannot use A\B as Foo because the name is already in use in %sns_030.php on line 5 +Fatal error: Cannot import class A\B as Foo, Foo has already been declared in %s on line %d diff --git a/Zend/tests/ns_033.phpt b/Zend/tests/ns_033.phpt index 39bcf80916608..7cdbbd003e79b 100644 --- a/Zend/tests/ns_033.phpt +++ b/Zend/tests/ns_033.phpt @@ -6,6 +6,6 @@ use A; use \B; ?> --EXPECTF-- -Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2 +Warning: Importing the global symbol A has no effect in the global scope in %s on line %d -Warning: The use statement with non-compound name 'B' has no effect in %sns_033.php on line 3 +Warning: Importing the global symbol B has no effect in the global scope in %s on line %d diff --git a/Zend/tests/ns_075.phpt b/Zend/tests/ns_075.phpt index 617e7777ff87f..34df588c00af8 100644 --- a/Zend/tests/ns_075.phpt +++ b/Zend/tests/ns_075.phpt @@ -8,4 +8,4 @@ const NULL = 1; echo NULL; ?> --EXPECTF-- -Fatal error: Cannot redeclare constant 'NULL' in %sns_075.php on line %d +Fatal error: Constant "NULL" cannot be declared, NULL is a reserved constant name in %s on line %d diff --git a/Zend/tests/nullsafe_operator/004.phpt b/Zend/tests/nullsafe_operator/004.phpt index 0dc95d3f1a558..45514851f822e 100644 --- a/Zend/tests/nullsafe_operator/004.phpt +++ b/Zend/tests/nullsafe_operator/004.phpt @@ -8,4 +8,4 @@ var_dump($foo?->bar = 'bar'); ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/005.phpt b/Zend/tests/nullsafe_operator/005.phpt index e691401599110..fa44e891142c9 100644 --- a/Zend/tests/nullsafe_operator/005.phpt +++ b/Zend/tests/nullsafe_operator/005.phpt @@ -8,4 +8,4 @@ $foo?->bar += 1; ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/006.phpt b/Zend/tests/nullsafe_operator/006.phpt index 2cbecd2dda2bc..1141702349d28 100644 --- a/Zend/tests/nullsafe_operator/006.phpt +++ b/Zend/tests/nullsafe_operator/006.phpt @@ -8,4 +8,4 @@ $foo = null; ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/007.phpt b/Zend/tests/nullsafe_operator/007.phpt index a04af8ea83c03..7fb283c0d3308 100644 --- a/Zend/tests/nullsafe_operator/007.phpt +++ b/Zend/tests/nullsafe_operator/007.phpt @@ -8,4 +8,4 @@ var_dump($foo?->bar++); ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/008.phpt b/Zend/tests/nullsafe_operator/008.phpt index 360d137b86c1c..e50165b2637a7 100644 --- a/Zend/tests/nullsafe_operator/008.phpt +++ b/Zend/tests/nullsafe_operator/008.phpt @@ -8,4 +8,4 @@ var_dump($foo?->bar ??= 'bar'); ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/009.phpt b/Zend/tests/nullsafe_operator/009.phpt index 95df9dacc855c..965508fea605d 100644 --- a/Zend/tests/nullsafe_operator/009.phpt +++ b/Zend/tests/nullsafe_operator/009.phpt @@ -8,4 +8,4 @@ $ref = &$foo?->bar ?> --EXPECTF-- -Fatal error: Cannot take reference of a nullsafe chain in %s.php on line 4 +Fatal error: Cannot take reference of a null-safe chain in %s on line %d diff --git a/Zend/tests/nullsafe_operator/010.phpt b/Zend/tests/nullsafe_operator/010.phpt index 9f423a7c1e32b..78b629c533f47 100644 --- a/Zend/tests/nullsafe_operator/010.phpt +++ b/Zend/tests/nullsafe_operator/010.phpt @@ -8,4 +8,4 @@ $ref = &$foo?->bar->baz; ?> --EXPECTF-- -Fatal error: Cannot take reference of a nullsafe chain in %s.php on line 4 +Fatal error: Cannot take reference of a null-safe chain in %s on line %d diff --git a/Zend/tests/nullsafe_operator/017.phpt b/Zend/tests/nullsafe_operator/017.phpt index b38a371bf036c..7a2377659f5e5 100644 --- a/Zend/tests/nullsafe_operator/017.phpt +++ b/Zend/tests/nullsafe_operator/017.phpt @@ -9,4 +9,4 @@ function &get_bar_ref($foo) { ?> --EXPECTF-- -Fatal error: Cannot take reference of a nullsafe chain in %s.php on line 4 +Fatal error: Cannot take reference of a null-safe chain in %s on line %d diff --git a/Zend/tests/nullsafe_operator/020.phpt b/Zend/tests/nullsafe_operator/020.phpt index 4d06ce616cc16..7900c0962481a 100644 --- a/Zend/tests/nullsafe_operator/020.phpt +++ b/Zend/tests/nullsafe_operator/020.phpt @@ -16,4 +16,4 @@ $foo?->bar->baz = bar(); ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 12 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/022.phpt b/Zend/tests/nullsafe_operator/022.phpt index 6dbb72d9b5457..9d819b07f735b 100644 --- a/Zend/tests/nullsafe_operator/022.phpt +++ b/Zend/tests/nullsafe_operator/022.phpt @@ -8,4 +8,4 @@ unset($foo?->bar->baz); ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/nullsafe_operator/024.phpt b/Zend/tests/nullsafe_operator/024.phpt index 220e9ea5062b9..1e82928ba228e 100644 --- a/Zend/tests/nullsafe_operator/024.phpt +++ b/Zend/tests/nullsafe_operator/024.phpt @@ -8,4 +8,4 @@ foreach ([1, 2, 3] as $foo?->bar) {} ?> --EXPECTF-- -Fatal error: Can't use nullsafe operator in write context in %s.php on line 4 +Fatal error: Cannot use the null-safe operator in write context in %s on line %d diff --git a/Zend/tests/offset_array.phpt b/Zend/tests/offset_array.phpt index bd6baa1651635..a90a842a756e8 100644 --- a/Zend/tests/offset_array.phpt +++ b/Zend/tests/offset_array.phpt @@ -46,6 +46,6 @@ int(1) Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d int(%d) -Illegal offset type -Illegal offset type +Illegal array key type: stdClass +Illegal array key type: array Done diff --git a/Zend/tests/required_param_after_optional.phpt b/Zend/tests/required_param_after_optional.phpt index cd715e77d4819..6f178a651c763 100644 --- a/Zend/tests/required_param_after_optional.phpt +++ b/Zend/tests/required_param_after_optional.phpt @@ -9,6 +9,6 @@ function test3(Type $test3A = null, Type2 $test3B = null, $test3C) {} ?> --EXPECTF-- -Deprecated: Required parameter $testC follows optional parameter $testA in %s on line %d +Deprecated: Required parameter $testC should precede optional parameter $testA in %s on line %d -Deprecated: Required parameter $test2C follows optional parameter $test2B in %s on line %d +Deprecated: Required parameter $test2C should precede optional parameter $test2B in %s on line %d diff --git a/Zend/tests/return_types/024.phpt b/Zend/tests/return_types/024.phpt index 444a9523b6a42..163e542045ea4 100644 --- a/Zend/tests/return_types/024.phpt +++ b/Zend/tests/return_types/024.phpt @@ -6,4 +6,4 @@ Return type of self is not allowed in function function test(): self {} ?> --EXPECTF-- -Fatal error: Cannot use "self" when no class scope is active in %s on line 3 +Fatal error: "self" must be used only in a class scope in %s on line %d diff --git a/Zend/tests/return_types/026.phpt b/Zend/tests/return_types/026.phpt index 5229379df5fe2..0d498ec2defe5 100644 --- a/Zend/tests/return_types/026.phpt +++ b/Zend/tests/return_types/026.phpt @@ -6,4 +6,4 @@ Return type of parent is not allowed in function function test(): parent {} ?> --EXPECTF-- -Fatal error: Cannot use "parent" when no class scope is active in %s on line %d +Fatal error: "parent" must be used only in a class scope in %s on line %d diff --git a/Zend/tests/return_types/generators002.phpt b/Zend/tests/return_types/generators002.phpt index 37cc42b3ec9ea..e5c310484776b 100644 --- a/Zend/tests/return_types/generators002.phpt +++ b/Zend/tests/return_types/generators002.phpt @@ -7,4 +7,4 @@ function test1() : StdClass { } ?> --EXPECTF-- -Fatal error: Generator return type must be a supertype of Generator, StdClass given in %s on line %d +Fatal error: test1(): Generator return type must be a supertype of Generator, StdClass declared in %s on line %d diff --git a/Zend/tests/return_types/generators006.phpt b/Zend/tests/return_types/generators006.phpt index 71ea4d9a83d8a..79c1d670006d0 100644 --- a/Zend/tests/return_types/generators006.phpt +++ b/Zend/tests/return_types/generators006.phpt @@ -7,4 +7,4 @@ function test1() : StdClass|ArrayObject|array { } ?> --EXPECTF-- -Fatal error: Generator return type must be a supertype of Generator, StdClass|ArrayObject|array given in %s on line %d +Fatal error: test1(): Generator return type must be a supertype of Generator, StdClass|ArrayObject|array declared in %s on line %d diff --git a/Zend/tests/self_class_const_outside_class.phpt b/Zend/tests/self_class_const_outside_class.phpt index 7a1f989a55340..a69d6973f816b 100644 --- a/Zend/tests/self_class_const_outside_class.phpt +++ b/Zend/tests/self_class_const_outside_class.phpt @@ -7,4 +7,4 @@ function test() { } ?> --EXPECTF-- -Fatal error: Cannot use "self" when no class scope is active in %s on line %d +Fatal error: "self" must be used only in a class scope in %s on line %d diff --git a/Zend/tests/special_name_error2.phpt b/Zend/tests/special_name_error2.phpt index 08122b3249e16..b1f68479de1ad 100644 --- a/Zend/tests/special_name_error2.phpt +++ b/Zend/tests/special_name_error2.phpt @@ -7,4 +7,4 @@ use Foo\Bar as self; ?> --EXPECTF-- -Fatal error: Cannot use Foo\Bar as self because 'self' is a special class name in %s on line %d +Fatal error: Cannot import class Foo\Bar as "self", self is a reserved class nam in %s on line %d diff --git a/Zend/tests/special_name_error3.phpt b/Zend/tests/special_name_error3.phpt index 74e69f19385f3..ec58de0cf9cef 100644 --- a/Zend/tests/special_name_error3.phpt +++ b/Zend/tests/special_name_error3.phpt @@ -7,4 +7,4 @@ trait self {} ?> --EXPECTF-- -Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d +Fatal error: Class "self" cannot be declared, self is a reserved class name in %s on line %d diff --git a/Zend/tests/static_in_trait_insteadof_list.phpt b/Zend/tests/static_in_trait_insteadof_list.phpt index 77ecf1e42baa3..37f6f00720cff 100644 --- a/Zend/tests/static_in_trait_insteadof_list.phpt +++ b/Zend/tests/static_in_trait_insteadof_list.phpt @@ -15,4 +15,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot use 'static' as trait name, as it is reserved in %s on line %d +Fatal error: Cannot use "static" as trait name, static is a reserved class name in %s on line %d diff --git a/Zend/tests/static_in_trait_insteadof_reference.phpt b/Zend/tests/static_in_trait_insteadof_reference.phpt index 95a6b3c170668..b402ae816d6e4 100644 --- a/Zend/tests/static_in_trait_insteadof_reference.phpt +++ b/Zend/tests/static_in_trait_insteadof_reference.phpt @@ -15,4 +15,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot use 'static' as trait name, as it is reserved in %s on line %d +Fatal error: Cannot use "static" as trait name, static is a reserved class name in %s on line %d diff --git a/Zend/tests/traits/error_013.phpt b/Zend/tests/traits/error_013.phpt index 1fbf607bb7097..e077086fad634 100644 --- a/Zend/tests/traits/error_013.phpt +++ b/Zend/tests/traits/error_013.phpt @@ -16,4 +16,4 @@ var_dump($x->test()); ?> --EXPECTF-- -Fatal error: Cannot use 'static' as method modifier in %s on line %d +Fatal error: Cannot use "static" as a trait method alias in %s on line %d diff --git a/Zend/tests/traits/error_016.phpt b/Zend/tests/traits/error_016.phpt index 191225ddee7a4..f190f67e5ded4 100644 --- a/Zend/tests/traits/error_016.phpt +++ b/Zend/tests/traits/error_016.phpt @@ -9,4 +9,4 @@ trait foo { ?> --EXPECTF-- -Fatal error: Traits cannot have constants in %s on line %d +Fatal error: Trait foo cannot define constants in %s on line %d diff --git a/Zend/tests/traits/language018.phpt b/Zend/tests/traits/language018.phpt index 714794a296703..a3c74af1710e0 100644 --- a/Zend/tests/traits/language018.phpt +++ b/Zend/tests/traits/language018.phpt @@ -12,4 +12,4 @@ class C1 { } ?> --EXPECTF-- -Fatal error: Cannot use 'abstract' as method modifier in %s on line %d +Fatal error: Cannot use "abstract" as a trait method alias in %s on line %d diff --git a/Zend/tests/traits/language019.phpt b/Zend/tests/traits/language019.phpt index 7764054ebd987..5732b2b7cf039 100644 --- a/Zend/tests/traits/language019.phpt +++ b/Zend/tests/traits/language019.phpt @@ -12,4 +12,4 @@ class C1 { } ?> --EXPECTF-- -Fatal error: Cannot use 'final' as method modifier in %s on line %d +Fatal error: Cannot use "final" as a trait method alias in %s on line %d diff --git a/Zend/tests/try/try_finally_011.phpt b/Zend/tests/try/try_finally_011.phpt index 1262edfef25fc..c48a8ca9405dc 100644 --- a/Zend/tests/try/try_finally_011.phpt +++ b/Zend/tests/try/try_finally_011.phpt @@ -12,4 +12,4 @@ function foo () { foo(); ?> --EXPECTF-- -Fatal error: 'break' not in the 'loop' or 'switch' context in %stry_finally_011.php on line %d +Fatal error: The break statement can only be used inside a loop or a switch in %s on line %d diff --git a/Zend/tests/type_declarations/confusable_type_warning.phpt b/Zend/tests/type_declarations/confusable_type_warning.phpt index 44bd173451948..e2f8f380aed73 100644 --- a/Zend/tests/type_declarations/confusable_type_warning.phpt +++ b/Zend/tests/type_declarations/confusable_type_warning.phpt @@ -41,7 +41,7 @@ Warning: "double" will be interpreted as a class name. Did you mean "float"? Wri Warning: "boolean" will be interpreted as a class name. Did you mean "bool"? Write "\boolean" to suppress this warning in %s on line %d -Warning: "resource" is not a supported builtin type and will be interpreted as a class name. Write "\resource" to suppress this warning in %s on line %d +Warning: "resource" is not a supported built-in type and will be interpreted as a class name. Write "\resource" to suppress this warning in %s on line %d Warning: "boolean" will be interpreted as a class name. Did you mean "bool"? Write "\Foo\boolean" or import the class with "use" to suppress this warning in %s on line %d diff --git a/Zend/tests/type_declarations/mixed/syntax/mixed_class_error.phpt b/Zend/tests/type_declarations/mixed/syntax/mixed_class_error.phpt index 8a5a385576f8a..04bd7529e4b23 100644 --- a/Zend/tests/type_declarations/mixed/syntax/mixed_class_error.phpt +++ b/Zend/tests/type_declarations/mixed/syntax/mixed_class_error.phpt @@ -9,4 +9,4 @@ class mixed ?> --EXPECTF-- -Fatal error: Cannot use 'mixed' as class name as it is reserved in %s on line %d +Fatal error: Class "mixed" cannot be declared, mixed is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_relative_typehint_disallowed.phpt b/Zend/tests/type_declarations/scalar_relative_typehint_disallowed.phpt index 7f53b49b9c630..6579083a6605c 100644 --- a/Zend/tests/type_declarations/scalar_relative_typehint_disallowed.phpt +++ b/Zend/tests/type_declarations/scalar_relative_typehint_disallowed.phpt @@ -11,4 +11,4 @@ foo(10); ?> --EXPECTF-- -Fatal error: Cannot use 'bar\int' as class name as it is reserved in %s on line %d +Fatal error: Class "bar\int" cannot be declared, bar\int is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved2.phpt b/Zend/tests/type_declarations/scalar_reserved2.phpt index 4e1cca3d4012d..af3440ca41b5c 100644 --- a/Zend/tests/type_declarations/scalar_reserved2.phpt +++ b/Zend/tests/type_declarations/scalar_reserved2.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (2) class int {} ?> --EXPECTF-- -Fatal error: Cannot use 'int' as class name as it is reserved in %s on line %d +Fatal error: Class "int" cannot be declared, int is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved2_class_alias.phpt b/Zend/tests/type_declarations/scalar_reserved2_class_alias.phpt index ae9e890516926..82c488a5bc686 100644 --- a/Zend/tests/type_declarations/scalar_reserved2_class_alias.phpt +++ b/Zend/tests/type_declarations/scalar_reserved2_class_alias.phpt @@ -7,4 +7,4 @@ class foobar {} class_alias("foobar", "int"); ?> --EXPECTF-- -Fatal error: Cannot use 'int' as class name as it is reserved in %s on line %d +Fatal error: Class "int" cannot be declared, int is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved2_use.phpt b/Zend/tests/type_declarations/scalar_reserved2_use.phpt index 63af0b11f7568..e913672c73cb7 100644 --- a/Zend/tests/type_declarations/scalar_reserved2_use.phpt +++ b/Zend/tests/type_declarations/scalar_reserved2_use.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (2) - use use foobar as int; ?> --EXPECTF-- -Fatal error: Cannot use foobar as int because 'int' is a special class name in %s on line %d +Fatal error: Cannot import class foobar as "int", int is a reserved class nam in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved3.phpt b/Zend/tests/type_declarations/scalar_reserved3.phpt index 932bf624cc007..bd9fa594ea22a 100644 --- a/Zend/tests/type_declarations/scalar_reserved3.phpt +++ b/Zend/tests/type_declarations/scalar_reserved3.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (3) class float {} ?> --EXPECTF-- -Fatal error: Cannot use 'float' as class name as it is reserved in %s on line %d +Fatal error: Class "float" cannot be declared, float is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved3_class_alias.phpt b/Zend/tests/type_declarations/scalar_reserved3_class_alias.phpt index a7387495a31be..b93bfbbc167d4 100644 --- a/Zend/tests/type_declarations/scalar_reserved3_class_alias.phpt +++ b/Zend/tests/type_declarations/scalar_reserved3_class_alias.phpt @@ -7,4 +7,4 @@ class foobar {} class_alias("foobar", "float"); ?> --EXPECTF-- -Fatal error: Cannot use 'float' as class name as it is reserved in %s on line %d +Fatal error: Class "float" cannot be declared, float is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved3_use.phpt b/Zend/tests/type_declarations/scalar_reserved3_use.phpt index 094ac8ebecad7..fc99fafe52e4a 100644 --- a/Zend/tests/type_declarations/scalar_reserved3_use.phpt +++ b/Zend/tests/type_declarations/scalar_reserved3_use.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (3) - use use foobar as float; ?> --EXPECTF-- -Fatal error: Cannot use foobar as float because 'float' is a special class name in %s on line %d +Fatal error: Cannot import class foobar as "float", float is a reserved class nam in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved4.phpt b/Zend/tests/type_declarations/scalar_reserved4.phpt index 7cd5ae5775902..bb779c10cbf15 100644 --- a/Zend/tests/type_declarations/scalar_reserved4.phpt +++ b/Zend/tests/type_declarations/scalar_reserved4.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (4) class string {} ?> --EXPECTF-- -Fatal error: Cannot use 'string' as class name as it is reserved in %s on line %d +Fatal error: Class "string" cannot be declared, string is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved4_class_alias.phpt b/Zend/tests/type_declarations/scalar_reserved4_class_alias.phpt index 311503ec61177..355b5b9d31536 100644 --- a/Zend/tests/type_declarations/scalar_reserved4_class_alias.phpt +++ b/Zend/tests/type_declarations/scalar_reserved4_class_alias.phpt @@ -7,4 +7,4 @@ class foobar {} class_alias("foobar", "string"); ?> --EXPECTF-- -Fatal error: Cannot use 'string' as class name as it is reserved in %s on line %d +Fatal error: Class "string" cannot be declared, string is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved4_use.phpt b/Zend/tests/type_declarations/scalar_reserved4_use.phpt index 0d068a4f61095..e4e40e5083ddf 100644 --- a/Zend/tests/type_declarations/scalar_reserved4_use.phpt +++ b/Zend/tests/type_declarations/scalar_reserved4_use.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (4) - use use foobar as string; ?> --EXPECTF-- -Fatal error: Cannot use foobar as string because 'string' is a special class name in %s on line %d +Fatal error: Cannot import class foobar as "string", string is a reserved class nam in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved6.phpt b/Zend/tests/type_declarations/scalar_reserved6.phpt index dca439d212203..d026488ee0a28 100644 --- a/Zend/tests/type_declarations/scalar_reserved6.phpt +++ b/Zend/tests/type_declarations/scalar_reserved6.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (6) class bool {} ?> --EXPECTF-- -Fatal error: Cannot use 'bool' as class name as it is reserved in %s on line %d +Fatal error: Class "bool" cannot be declared, bool is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved6_class_alias.phpt b/Zend/tests/type_declarations/scalar_reserved6_class_alias.phpt index 9aa060058a073..9a17330644ab2 100644 --- a/Zend/tests/type_declarations/scalar_reserved6_class_alias.phpt +++ b/Zend/tests/type_declarations/scalar_reserved6_class_alias.phpt @@ -7,4 +7,4 @@ class foobar {} class_alias("foobar", "bool"); ?> --EXPECTF-- -Fatal error: Cannot use 'bool' as class name as it is reserved in %s on line %d +Fatal error: Class "bool" cannot be declared, bool is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved6_use.phpt b/Zend/tests/type_declarations/scalar_reserved6_use.phpt index a19a513b3948d..7ab0089fd3e65 100644 --- a/Zend/tests/type_declarations/scalar_reserved6_use.phpt +++ b/Zend/tests/type_declarations/scalar_reserved6_use.phpt @@ -6,4 +6,4 @@ Scalar type names cannot be used as class, trait or interface names (6) - use use foobar as bool; ?> --EXPECTF-- -Fatal error: Cannot use foobar as bool because 'bool' is a special class name in %s on line %d +Fatal error: Cannot import class foobar as "bool", bool is a reserved class nam in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_reserved7.phpt b/Zend/tests/type_declarations/scalar_reserved7.phpt index 1ab7a67204a06..333db368a92ba 100644 --- a/Zend/tests/type_declarations/scalar_reserved7.phpt +++ b/Zend/tests/type_declarations/scalar_reserved7.phpt @@ -7,4 +7,4 @@ namespace foo; class int {} ?> --EXPECTF-- -Fatal error: Cannot use 'int' as class name as it is reserved in %s on line %d +Fatal error: Class "int" cannot be declared, int is a reserved class name in %s on line %d diff --git a/Zend/tests/type_declarations/static_type_outside_class.phpt b/Zend/tests/type_declarations/static_type_outside_class.phpt index f485e394b4e48..cddfd0bbe352d 100644 --- a/Zend/tests/type_declarations/static_type_outside_class.phpt +++ b/Zend/tests/type_declarations/static_type_outside_class.phpt @@ -7,4 +7,4 @@ function test(): static {} ?> --EXPECTF-- -Fatal error: Cannot use "static" when no class scope is active in %s on line %d +Fatal error: Type static cannot be used in the global scope in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_013.phpt b/Zend/tests/type_declarations/typed_properties_013.phpt index fb481d66cd64d..0d89e06f8dee4 100644 --- a/Zend/tests/type_declarations/typed_properties_013.phpt +++ b/Zend/tests/type_declarations/typed_properties_013.phpt @@ -7,4 +7,4 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Cannot use string as default value for property Foo::$bar of type int in %s on line 3 +Fatal error: Property string::$Foo of type bar cannot have a default value of type int in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_014.phpt b/Zend/tests/type_declarations/typed_properties_014.phpt index 161f2e2a5a22a..92c0f1802012e 100644 --- a/Zend/tests/type_declarations/typed_properties_014.phpt +++ b/Zend/tests/type_declarations/typed_properties_014.phpt @@ -7,4 +7,4 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Cannot use int as default value for property Foo::$bar of type array in %s on line 3 +Fatal error: Property int::$Foo of type bar cannot have a default value of type array in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_015.phpt b/Zend/tests/type_declarations/typed_properties_015.phpt index a40b8764b5f40..ed749e2d146e3 100644 --- a/Zend/tests/type_declarations/typed_properties_015.phpt +++ b/Zend/tests/type_declarations/typed_properties_015.phpt @@ -7,4 +7,4 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Default value for property of type stdClass may not be null. Use the nullable type ?stdClass to allow null default value in %s on line %d +Fatal error: Property Foo:$bar of type stdClass cannot have a default value of null. Use the nullable type ?stdClass to allow a null default value in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_017.phpt b/Zend/tests/type_declarations/typed_properties_017.phpt index 306b40f72c4ba..1ac8739d9b4a3 100644 --- a/Zend/tests/type_declarations/typed_properties_017.phpt +++ b/Zend/tests/type_declarations/typed_properties_017.phpt @@ -9,4 +9,4 @@ class Foo { $foo = new Foo(); ?> --EXPECTF-- -Fatal error: Property Foo::$int cannot have type void in %s on line 3 +Fatal error: Property Foo::$int cannot be of type void in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_049.phpt b/Zend/tests/type_declarations/typed_properties_049.phpt index ed4f07e4b66d2..1d1b17f1394d1 100644 --- a/Zend/tests/type_declarations/typed_properties_049.phpt +++ b/Zend/tests/type_declarations/typed_properties_049.phpt @@ -7,4 +7,4 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Default value for property of type int may not be null. Use the nullable type ?int to allow null default value in %s on line %d +Fatal error: Property Foo:$foo of type int cannot have a default value of null. Use the nullable type ?int to allow a null default value in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_053.phpt b/Zend/tests/type_declarations/typed_properties_053.phpt index 3b347795b3254..058328d39ba1a 100644 --- a/Zend/tests/type_declarations/typed_properties_053.phpt +++ b/Zend/tests/type_declarations/typed_properties_053.phpt @@ -9,4 +9,4 @@ $obj = new A; var_dump($obj); ?> --EXPECTF-- -Fatal error: Property A::$a cannot have type callable in %s on line %d +Fatal error: Property A::$a cannot be of type callable in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_054.phpt b/Zend/tests/type_declarations/typed_properties_054.phpt index 281d59f26c61b..1b5332d1c33c0 100644 --- a/Zend/tests/type_declarations/typed_properties_054.phpt +++ b/Zend/tests/type_declarations/typed_properties_054.phpt @@ -9,4 +9,4 @@ $obj = new A; var_dump($obj); ?> --EXPECTF-- -Fatal error: Property A::$a cannot have type ?callable in %s on line %d +Fatal error: Property A::$a cannot be of type ?callable in %s on line %d diff --git a/Zend/tests/type_declarations/union_types/illegal_default_value_property.phpt b/Zend/tests/type_declarations/union_types/illegal_default_value_property.phpt index f5941751dc22e..aa15c7878a278 100644 --- a/Zend/tests/type_declarations/union_types/illegal_default_value_property.phpt +++ b/Zend/tests/type_declarations/union_types/illegal_default_value_property.phpt @@ -9,4 +9,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot use string as default value for property Test::$prop of type int|float in %s on line %d +Fatal error: Property string::$Test of type prop cannot have a default value of type int|float in %s on line %d diff --git a/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt b/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt index 6bbf4881a89c2..f557f1a9c83e4 100644 --- a/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt +++ b/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt @@ -13,4 +13,4 @@ class B extends A { ?> --EXPECTF-- -Fatal error: Cannot use "parent" when current class scope has no parent in %s on line %d +Fatal error: "parent" must be used only in a class scope with a parent class in %s on line %d diff --git a/Zend/tests/typehints/bug76198.phpt b/Zend/tests/typehints/bug76198.phpt index 8d71d02461b9f..5250973df7b68 100644 --- a/Zend/tests/typehints/bug76198.phpt +++ b/Zend/tests/typehints/bug76198.phpt @@ -10,4 +10,4 @@ var_dump(foo()); ?> --EXPECTF-- -Fatal error: Type declaration 'iterable' must be unqualified in %s on line %d +Fatal error: Type declaration "iterable" must be unqualified in %s on line %d diff --git a/Zend/tests/typehints/fully_qualified_scalar.phpt b/Zend/tests/typehints/fully_qualified_scalar.phpt index 9fdfcb901cc32..10f25f751aae0 100644 --- a/Zend/tests/typehints/fully_qualified_scalar.phpt +++ b/Zend/tests/typehints/fully_qualified_scalar.phpt @@ -10,4 +10,4 @@ foo(1); ?> --EXPECTF-- -Fatal error: Type declaration 'int' must be unqualified in %s on line %d +Fatal error: Type declaration "int" must be unqualified in %s on line %d diff --git a/Zend/tests/typehints/namespace_relative_scalar.phpt b/Zend/tests/typehints/namespace_relative_scalar.phpt index 096d047387191..9868198f686cc 100644 --- a/Zend/tests/typehints/namespace_relative_scalar.phpt +++ b/Zend/tests/typehints/namespace_relative_scalar.phpt @@ -8,4 +8,4 @@ test(0); ?> --EXPECTF-- -Fatal error: Type declaration 'int' must be unqualified in %s on line %d +Fatal error: Type declaration "int" must be unqualified in %s on line %d diff --git a/Zend/tests/use_const/conflicting_use.phpt b/Zend/tests/use_const/conflicting_use.phpt index 3b3c4b3262e79..3ccdb4a77e1f0 100644 --- a/Zend/tests/use_const/conflicting_use.phpt +++ b/Zend/tests/use_const/conflicting_use.phpt @@ -18,4 +18,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot use const bar\baz as baz because the name is already in use in %s on line %d +Fatal error: Cannot import constant bar\baz as baz, baz has already been declared in %s on line %d diff --git a/Zend/tests/use_const/define_imported.phpt b/Zend/tests/use_const/define_imported.phpt index 5eb44be64a058..6958cf85c3e6f 100644 --- a/Zend/tests/use_const/define_imported.phpt +++ b/Zend/tests/use_const/define_imported.phpt @@ -11,4 +11,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot declare const bar because the name is already in use in %s on line %d +Fatal error: Constant bar has already been declared in %s on line %d diff --git a/Zend/tests/use_const/define_imported_before.phpt b/Zend/tests/use_const/define_imported_before.phpt index f674ce81e8ec2..21778cbe89028 100644 --- a/Zend/tests/use_const/define_imported_before.phpt +++ b/Zend/tests/use_const/define_imported_before.phpt @@ -15,4 +15,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot use const foo\bar as bar because the name is already in use in %s on line %d +Fatal error: Cannot import constant foo\bar as bar, bar has already been declared in %s on line %d diff --git a/Zend/tests/use_function/case_insensivity.phpt b/Zend/tests/use_function/case_insensivity.phpt index ba6e3a7e4b1b5..54fd4872d3d52 100644 --- a/Zend/tests/use_function/case_insensivity.phpt +++ b/Zend/tests/use_function/case_insensivity.phpt @@ -10,4 +10,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot use function foo\BAR as BAR because the name is already in use in %s on line %d +Fatal error: Cannot import function foo\BAR as BAR, BAR has already been declared in %s on line %d diff --git a/Zend/tests/use_function/conditional_function_declaration.phpt b/Zend/tests/use_function/conditional_function_declaration.phpt index 02ac0803f09e7..2624bfe36f94b 100644 --- a/Zend/tests/use_function/conditional_function_declaration.phpt +++ b/Zend/tests/use_function/conditional_function_declaration.phpt @@ -14,4 +14,4 @@ echo "Done"; ?> --EXPECTF-- -Fatal error: Cannot use function bar\foo as foo because the name is already in use in %s on line %d +Fatal error: Cannot import function bar\foo as foo, foo has already been declared in %s on line %d diff --git a/Zend/tests/use_function/conflicting_use.phpt b/Zend/tests/use_function/conflicting_use.phpt index 0221fbdebb38a..6e212e6d2a306 100644 --- a/Zend/tests/use_function/conflicting_use.phpt +++ b/Zend/tests/use_function/conflicting_use.phpt @@ -22,4 +22,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot use function bar\baz as baz because the name is already in use in %s on line %d +Fatal error: Cannot import function bar\baz as baz, baz has already been declared in %s on line %d diff --git a/Zend/tests/use_function/define_imported.phpt b/Zend/tests/use_function/define_imported.phpt index c542a4d5494b9..7fd61e854177e 100644 --- a/Zend/tests/use_function/define_imported.phpt +++ b/Zend/tests/use_function/define_imported.phpt @@ -11,4 +11,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot declare function bar because the name is already in use in %s on line %d +Fatal error: Function bar() has already been declared in %s on line %d diff --git a/Zend/tests/use_function/define_imported_before.phpt b/Zend/tests/use_function/define_imported_before.phpt index 91974e0783d15..5aec79c6624ad 100644 --- a/Zend/tests/use_function/define_imported_before.phpt +++ b/Zend/tests/use_function/define_imported_before.phpt @@ -15,4 +15,4 @@ namespace { ?> --EXPECTF-- -Fatal error: Cannot use function foo\bar as bar because the name is already in use in %s on line %d +Fatal error: Cannot import function foo\bar as bar, bar has already been declared in %s on line %d diff --git a/Zend/tests/use_late_binding_conflict.phpt b/Zend/tests/use_late_binding_conflict.phpt index c8514d0b1a7c3..c7c4306bef82a 100644 --- a/Zend/tests/use_late_binding_conflict.phpt +++ b/Zend/tests/use_late_binding_conflict.phpt @@ -10,4 +10,4 @@ use Foo\B; ?> --EXPECTF-- -Fatal error: Cannot use Foo\B as B because the name is already in use in %s on line %d +Fatal error: Cannot import class Foo\B as B, B has already been declared in %s on line %d diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 773c38f979913..a91c71f866613 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1709,7 +1709,7 @@ ZEND_API zend_result array_set_zval_key(HashTable *ht, zval *key, zval *value) / result = zend_hash_index_update(ht, zend_dval_to_lval(Z_DVAL_P(key)), value); break; default: - zend_type_error("Illegal offset type"); + zend_type_error("Illegal array key type: %s", zend_zval_type_name(key)); result = NULL; } diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index cb61bec5d7644..68659a908f45d 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -471,7 +471,7 @@ static zend_result zend_ast_add_array_element(zval *result, zval *offset, zval * zend_hash_index_update(Z_ARRVAL_P(result), Z_RES_HANDLE_P(offset), expr); break; default: - zend_type_error("Illegal offset type"); + zend_type_error("Illegal array key type: %s", zend_zval_type_name(offset)); return FAILURE; } return SUCCESS; diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d5318f30a5a0e..e8a36f152a37f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -204,7 +204,7 @@ void zend_assert_valid_class_name(const zend_string *name) /* {{{ */ { if (zend_is_reserved_class_name(name)) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot use '%s' as class name as it is reserved", ZSTR_VAL(name)); + "Class \"%s\" cannot be declared, %s is a reserved class name", ZSTR_VAL(name), ZSTR_VAL(name)); } } /* }}} */ @@ -945,7 +945,7 @@ zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /* {{{ */ } /* Ensure that \self, \parent and \static are not used */ if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(name)) { - zend_error_noreturn(E_COMPILE_ERROR, "'\\%s' is an invalid class name", ZSTR_VAL(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Class name \"\\%s\" is invalid", ZSTR_VAL(name)); } return name; } @@ -982,7 +982,7 @@ zend_string *zend_resolve_class_name_ast(zend_ast *ast) /* {{{ */ { zval *class_name = zend_ast_get_zval(ast); if (Z_TYPE_P(class_name) != IS_STRING) { - zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name"); + zend_error_noreturn(E_COMPILE_ERROR, "Class name must be a string"); } return zend_resolve_class_name(Z_STR_P(class_name), ast->attr); } @@ -1060,12 +1060,12 @@ static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zen old_function = (zend_function*)Z_PTR_P(zv); if (old_function->type == ZEND_USER_FUNCTION && old_function->op_array.last > 0) { - zend_error_noreturn(error_level, "Cannot redeclare %s() (previously declared in %s:%d)", + zend_error_noreturn(error_level, "Function %s() has already been declared (previous declaration in %s:%d)", op_array ? ZSTR_VAL(op_array->function_name) : ZSTR_VAL(old_function->common.function_name), ZSTR_VAL(old_function->op_array.filename), old_function->op_array.opcodes[0].lineno); } else { - zend_error_noreturn(error_level, "Cannot redeclare %s()", + zend_error_noreturn(error_level, "Function %s() has already been declared", op_array ? ZSTR_VAL(op_array->function_name) : ZSTR_VAL(old_function->common.function_name)); } } @@ -1103,7 +1103,7 @@ ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name) /* if (UNEXPECTED(!zv)) { ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(lcname)); if (ce) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare %s %s, because the name is already in use", zend_get_object_type(ce), ZSTR_VAL(ce->name)); + zend_error_noreturn(E_COMPILE_ERROR, "%s %s has already been declared", zend_get_object_type(ce), ZSTR_VAL(ce->name)); return FAILURE; } else { do { @@ -1125,7 +1125,7 @@ ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name) /* ce = (zend_class_entry*)Z_PTR_P(zv); zv = zend_hash_set_bucket_key(EG(class_table), (Bucket*)zv, Z_STR_P(lcname)); if (UNEXPECTED(!zv)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare %s %s, because the name is already in use", zend_get_object_type(ce), ZSTR_VAL(ce->name)); + zend_error_noreturn(E_COMPILE_ERROR, "%s %s has already been declared", zend_get_object_type(ce), ZSTR_VAL(ce->name)); return FAILURE; } @@ -1255,7 +1255,7 @@ static void zend_mark_function_as_generator() /* {{{ */ { if (!CG(active_op_array)->function_name) { zend_error_noreturn(E_COMPILE_ERROR, - "The \"yield\" expression can only be used inside a function"); + "The \"yield\" statement can only be used inside a function"); } if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { @@ -1275,8 +1275,12 @@ static void zend_mark_function_as_generator() /* {{{ */ if (!valid_type) { zend_string *str = zend_type_to_string(return_type); zend_error_noreturn(E_COMPILE_ERROR, - "Generator return type must be a supertype of Generator, %s given", - ZSTR_VAL(str)); + "%s%s%s(): Generator return type must be a supertype of Generator, %s declared", + CG(active_class_entry) ? ZSTR_VAL(CG(active_class_entry)->name) : "", + CG(active_class_entry) ? "::" : "", + ZSTR_VAL(CG(active_op_array)->function_name), + ZSTR_VAL(str) + ); } } @@ -1385,7 +1389,7 @@ ZEND_API zend_result zend_unmangle_property_name_ex(const zend_string *name, con return SUCCESS; } if (ZSTR_LEN(name) < 3 || ZSTR_VAL(name)[1] == '\0') { - zend_error(E_NOTICE, "Illegal member variable name"); + zend_error(E_NOTICE, "Illegal property name"); *prop_name = ZSTR_VAL(name); if (prop_len) { *prop_len = ZSTR_LEN(name); @@ -1395,7 +1399,7 @@ ZEND_API zend_result zend_unmangle_property_name_ex(const zend_string *name, con class_name_len = zend_strnlen(ZSTR_VAL(name) + 1, ZSTR_LEN(name) - 2); if (class_name_len >= ZSTR_LEN(name) - 2 || ZSTR_VAL(name)[class_name_len + 1] != '\0') { - zend_error(E_NOTICE, "Corrupt member variable name"); + zend_error(E_NOTICE, "Corrupt property name"); *prop_name = ZSTR_VAL(name); if (prop_len) { *prop_len = ZSTR_LEN(name); @@ -1521,8 +1525,9 @@ static zend_string *zend_resolve_const_class_name_reference(zend_ast *ast, const zend_string *class_name = zend_ast_get_str(ast); if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type_ast(ast)) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot use '%s' as %s, as it is reserved", - ZSTR_VAL(class_name), type); + "Cannot use \"%s\" as %s, %s is a reserved class name", + ZSTR_VAL(class_name), type, ZSTR_VAL(class_name) + ); } return zend_resolve_class_name(class_name, ast->attr); } @@ -1532,12 +1537,12 @@ static void zend_ensure_valid_class_fetch_type(uint32_t fetch_type) /* {{{ */ if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && zend_is_scope_known()) { zend_class_entry *ce = CG(active_class_entry); if (!ce) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"%s\" when no class scope is active", + zend_error_noreturn(E_COMPILE_ERROR, "\"%s\" must be used only in a class scope", fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); } else if (fetch_type == ZEND_FETCH_CLASS_PARENT && !ce->parent_name) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot use \"parent\" when current class scope has no parent"); + "\"parent\" must be used only in a class scope with a parent class"); } } } @@ -2948,14 +2953,14 @@ static void zend_compile_list_assign( if (is_keyed) { if (key_ast == NULL) { zend_error(E_COMPILE_ERROR, - "Cannot mix keyed and unkeyed array entries in assignments"); + "Cannot mix array elements with and without keys in assignments"); } zend_compile_expr(&dim_node, key_ast); } else { if (key_ast != NULL) { zend_error(E_COMPILE_ERROR, - "Cannot mix keyed and unkeyed array entries in assignments"); + "Cannot mix array elements with and without keys in assignments"); } dim_node.op_type = IS_CONST; @@ -3002,17 +3007,17 @@ static void zend_compile_list_assign( static void zend_ensure_writable_variable(const zend_ast *ast) /* {{{ */ { if (ast->kind == ZEND_AST_CALL) { - zend_error_noreturn(E_COMPILE_ERROR, "Can't use function return value in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use function return value in write context"); } if ( ast->kind == ZEND_AST_METHOD_CALL || ast->kind == ZEND_AST_NULLSAFE_METHOD_CALL || ast->kind == ZEND_AST_STATIC_CALL ) { - zend_error_noreturn(E_COMPILE_ERROR, "Can't use method return value in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use method return value in write context"); } if (zend_ast_is_short_circuited(ast)) { - zend_error_noreturn(E_COMPILE_ERROR, "Can't use nullsafe operator in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the null-safe operator in write context"); } } /* }}} */ @@ -3120,7 +3125,7 @@ void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */ if (zend_propagate_list_refs(var_ast)) { if (!zend_is_variable_or_call(expr_ast)) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot assign reference to non referencable value"); + "Cannot assign reference to non-referencable value"); } zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1); @@ -3163,7 +3168,7 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */ } zend_ensure_writable_variable(target_ast); if (zend_ast_is_short_circuited(source_ast)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot take reference of a nullsafe chain"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot take reference of a null-safe chain"); } offset = zend_delayed_compile_begin(); @@ -4752,7 +4757,7 @@ void zend_compile_return(zend_ast *ast) /* {{{ */ ZVAL_NULL(&expr_node.u.constant); } else if (by_ref && zend_is_variable(expr_ast)) { if (zend_ast_is_short_circuited(expr_ast)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot take reference of a nullsafe chain"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot take reference of a null-safe chain"); } zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1); @@ -4834,13 +4839,13 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */ if (depth_ast) { zval *depth_zv; if (depth_ast->kind != ZEND_AST_ZVAL) { - zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-integer operand " + zend_error_noreturn(E_COMPILE_ERROR, "The %s statement with non-integer argument " "is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue"); } depth_zv = zend_ast_get_zval(depth_ast); if (Z_TYPE_P(depth_zv) != IS_LONG || Z_LVAL_P(depth_zv) < 1) { - zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive integers", + zend_error_noreturn(E_COMPILE_ERROR, "The %s statement accepts only an integer argument greater than or equal to 0", ast->kind == ZEND_AST_BREAK ? "break" : "continue"); } @@ -4850,11 +4855,11 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */ } if (CG(context).current_brk_cont == -1) { - zend_error_noreturn(E_COMPILE_ERROR, "'%s' not in the 'loop' or 'switch' context", + zend_error_noreturn(E_COMPILE_ERROR, "The %s statement can only be used inside a loop or a switch", ast->kind == ZEND_AST_BREAK ? "break" : "continue"); } else { if (!zend_handle_loops_and_finally_ex(depth, NULL)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' " ZEND_LONG_FMT " level%s", + zend_error_noreturn(E_COMPILE_ERROR, "Cannot %s " ZEND_LONG_FMT " level%s", ast->kind == ZEND_AST_BREAK ? "break" : "continue", depth, depth == 1 ? "" : "s"); } @@ -4902,7 +4907,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ CG(in_compilation) = 1; CG(active_op_array) = op_array; CG(zend_lineno) = opline->lineno; - zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label)); + zend_error_noreturn(E_COMPILE_ERROR, "goto to undefined label %s", Z_STRVAL_P(label)); } zval_ptr_dtor_str(label); @@ -4914,7 +4919,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ CG(in_compilation) = 1; CG(active_op_array) = op_array; CG(zend_lineno) = opline->lineno; - zend_error_noreturn(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed"); + zend_error_noreturn(E_COMPILE_ERROR, "goto into loop or switch statement is disallowed"); } if (CG(context).brk_cont_array[current].start >= 0) { remove_oplines--; @@ -4980,7 +4985,7 @@ void zend_compile_label(zend_ast *ast) /* {{{ */ dest.opline_num = get_next_op_number(); if (!zend_hash_add_mem(CG(context).labels, label, &dest, sizeof(zend_label))) { - zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", ZSTR_VAL(label)); + zend_error_noreturn(E_COMPILE_ERROR, "Label %s has already been defined", ZSTR_VAL(label)); } } /* }}} */ @@ -5327,7 +5332,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */ if (has_default_case) { CG(zend_lineno) = case_ast->lineno; zend_error_noreturn(E_COMPILE_ERROR, - "Switch statements may only contain one default clause"); + "Switch statements cannot contain more than one default clauses"); } has_default_case = 1; continue; @@ -5483,7 +5488,7 @@ void zend_compile_match(znode *result, zend_ast *ast) if (has_default_arm) { CG(zend_lineno) = arm_ast->lineno; zend_error_noreturn(E_COMPILE_ERROR, - "Match expressions may only contain one default arm"); + "Match expressions cannot contain more than one default arms"); } has_default_arm = 1; } @@ -5709,7 +5714,7 @@ void zend_compile_try(zend_ast *ast) /* {{{ */ zend_bool is_last_class = (j + 1 == classes->children); if (!zend_is_const_default_class_ref(class_ast)) { - zend_error_noreturn(E_COMPILE_ERROR, "Bad class name in the catch statement"); + zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name in the catch statement"); } opnum_catch = get_next_op_number(); @@ -5839,7 +5844,7 @@ zend_bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ new_encoding = zend_multibyte_fetch_encoding(ZSTR_VAL(encoding_name)); if (!new_encoding) { - zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", ZSTR_VAL(encoding_name)); + zend_error(E_COMPILE_WARNING, "Unsupported encoding %s", ZSTR_VAL(encoding_name)); } else { old_input_filter = LANG_SCNG(input_filter); old_encoding = LANG_SCNG(script_encoding); @@ -5854,7 +5859,7 @@ zend_bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ zend_string_release_ex(encoding_name, 0); } else { - zend_error(E_COMPILE_WARNING, "declare(encoding=...) ignored because " + zend_error(E_COMPILE_WARNING, "declare(encoding=...) is ignored, because " "Zend multibyte feature is turned off by settings"); } } @@ -5991,7 +5996,7 @@ static zend_type zend_compile_single_typename(zend_ast *ast) if (ast->kind == ZEND_AST_TYPE) { if (ast->attr == IS_STATIC && !CG(active_class_entry) && zend_is_scope_known()) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot use \"static\" when no class scope is active"); + "Type static cannot be used in the global scope"); } return (zend_type) ZEND_TYPE_INIT_CODE(ast->attr, 0, 0); } else { @@ -6001,7 +6006,7 @@ static zend_type zend_compile_single_typename(zend_ast *ast) if (type_code != 0) { if ((ast->attr & ZEND_NAME_NOT_FQ) != ZEND_NAME_NOT_FQ) { zend_error_noreturn(E_COMPILE_ERROR, - "Type declaration '%s' must be unqualified", + "Type declaration \"%s\" must be unqualified", ZSTR_VAL(zend_string_tolower(class_name))); } return (zend_type) ZEND_TYPE_INIT_CODE(type_code, 0, 0); @@ -6029,7 +6034,7 @@ static zend_type zend_compile_single_typename(zend_ast *ast) ZSTR_VAL(orig_name), correct_name, ZSTR_VAL(class_name), extra); } else { zend_error(E_COMPILE_WARNING, - "\"%s\" is not a supported builtin type " + "\"%s\" is not a supported built-in type " "and will be interpreted as a class name. " "Write \"\\%s\"%s to suppress this warning", ZSTR_VAL(orig_name), ZSTR_VAL(class_name), extra); @@ -6275,14 +6280,14 @@ static void zend_compile_attributes(HashTable **attributes, zend_ast *ast, uint3 zend_string *location = zend_get_attribute_target_names(target); zend_string *allowed = zend_get_attribute_target_names(config->flags); - zend_error_noreturn(E_ERROR, "Attribute \"%s\" cannot target %s (allowed targets: %s)", + zend_error_noreturn(E_ERROR, "Attribute %s cannot target %s (allowed targets: %s)", ZSTR_VAL(attr->name), ZSTR_VAL(location), ZSTR_VAL(allowed) ); } if (!(config->flags & ZEND_ATTRIBUTE_IS_REPEATABLE)) { if (zend_is_attribute_repeated(*attributes, attr)) { - zend_error_noreturn(E_ERROR, "Attribute \"%s\" must not be repeated", ZSTR_VAL(attr->name)); + zend_error_noreturn(E_ERROR, "Attribute %s cannot be repeated", ZSTR_VAL(attr->name)); } } @@ -6341,7 +6346,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall zend_arg_info *arg_info; if (zend_is_auto_global(name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", + zend_error_noreturn(E_COMPILE_ERROR, "Auto-global variable %s cannot be re-assigned", ZSTR_VAL(name)); } @@ -6391,7 +6396,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall default_node.op_type = IS_UNUSED; op_array->required_num_args = i + 1; if (optional_param) { - zend_error(E_DEPRECATED, "Required parameter $%s follows optional parameter $%s", + zend_error(E_DEPRECATED, "Required parameter $%s should precede optional parameter $%s", ZSTR_VAL(name), ZSTR_VAL(optional_param)); } } @@ -6450,7 +6455,9 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall scope && zend_is_constructor(op_array->function_name); if (!is_ctor) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot declare promoted property outside a constructor"); + "%s%s%s(): Promoted property $%s must be declared inside a constructor", + scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ZSTR_VAL(op_array->function_name), ZSTR_VAL(name) + ); } if ((op_array->fn_flags & ZEND_ACC_ABSTRACT) || (scope->ce_flags & ZEND_ACC_INTERFACE)) { @@ -6749,27 +6756,37 @@ zend_string *zend_begin_method_decl(zend_op_array *op_array, zend_string *name, } if (in_interface) { - if (!(fn_flags & ZEND_ACC_PUBLIC) || (fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_ABSTRACT))) { - zend_error_noreturn(E_COMPILE_ERROR, "Access type for interface method " - "%s::%s() must be omitted", ZSTR_VAL(ce->name), ZSTR_VAL(name)); + if (!(fn_flags & ZEND_ACC_PUBLIC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Interface method %s::%s() must have public visibility", + ZSTR_VAL(ce->name), ZSTR_VAL(name)); + } + if (fn_flags & ZEND_ACC_FINAL) { + zend_error_noreturn(E_COMPILE_ERROR, "Interface method %s::%s() cannot be final", + ZSTR_VAL(ce->name), ZSTR_VAL(name) + ); + } + if (fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_COMPILE_ERROR, "Interface method %s::%s() cannot be abstract", + ZSTR_VAL(ce->name), ZSTR_VAL(name) + ); } op_array->fn_flags |= ZEND_ACC_ABSTRACT; } if (op_array->fn_flags & ZEND_ACC_ABSTRACT) { if ((op_array->fn_flags & ZEND_ACC_PRIVATE) && !(ce->ce_flags & ZEND_ACC_TRAIT)) { - zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", + zend_error_noreturn(E_COMPILE_ERROR, "%s method %s::%s() must have public or protected visibility", in_interface ? "Interface" : "Abstract", ZSTR_VAL(ce->name), ZSTR_VAL(name)); } if (has_body) { - zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", + zend_error_noreturn(E_COMPILE_ERROR, "%s method %s::%s() cannot have a body", in_interface ? "Interface" : "Abstract", ZSTR_VAL(ce->name), ZSTR_VAL(name)); } ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; } else if (!has_body) { - zend_error_noreturn(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", + zend_error_noreturn(E_COMPILE_ERROR, "Non-abstract method %s::%s() must have body", ZSTR_VAL(ce->name), ZSTR_VAL(name)); } @@ -6780,7 +6797,7 @@ zend_string *zend_begin_method_decl(zend_op_array *op_array, zend_string *name, lcname = zend_new_interned_string(lcname); if (zend_hash_add_ptr(&ce->function_table, lcname, op_array) == NULL) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", + zend_error_noreturn(E_COMPILE_ERROR, "Method %s::%s() has already been declared", ZSTR_VAL(ce->name), ZSTR_VAL(name)); } @@ -6806,8 +6823,7 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as zend_string *import_name = zend_hash_find_ptr_lc(FC(imports_function), unqualified_name); if (import_name && !zend_string_equals_ci(lcname, import_name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare function %s " - "because the name is already in use", ZSTR_VAL(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Function %s() has already been declared", ZSTR_VAL(name)); } } @@ -6986,11 +7002,13 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, z uint32_t i, children = list->children; if (ce->ce_flags & ZEND_ACC_INTERFACE) { - zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables"); + zend_error_noreturn(E_COMPILE_ERROR, "Interface %s cannot have properties", ZSTR_VAL(ce->name)); } if (flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract"); + zend_error_noreturn(E_COMPILE_ERROR, "%s %s cannot declare properties as abstract", + ce->ce_flags & ZEND_ACC_TRAIT ? "Trait" : "Class", ZSTR_VAL(ce->name) + ); } for (i = 0; i < children; ++i) { @@ -7010,7 +7028,7 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, z if (ZEND_TYPE_FULL_MASK(type) & (MAY_BE_VOID|MAY_BE_CALLABLE)) { zend_string *str = zend_type_to_string(type); zend_error_noreturn(E_COMPILE_ERROR, - "Property %s::$%s cannot have type %s", + "Property %s::$%s cannot be of type %s", ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(str)); } } @@ -7021,13 +7039,13 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, z } if (flags & ZEND_ACC_FINAL) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, " + zend_error_noreturn(E_COMPILE_ERROR, "Property %s::$%s cannot be declared final, " "the final modifier is allowed only for methods and classes", ZSTR_VAL(ce->name), ZSTR_VAL(name)); } if (zend_hash_exists(&ce->properties_info, name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", + zend_error_noreturn(E_COMPILE_ERROR, "Property %s::$%s has already been declared", ZSTR_VAL(ce->name), ZSTR_VAL(name)); } @@ -7039,12 +7057,12 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, z zend_string *str = zend_type_to_string(type); if (Z_TYPE(value_zv) == IS_NULL) { zend_error_noreturn(E_COMPILE_ERROR, - "Default value for property of type %s may not be null. " - "Use the nullable type ?%s to allow null default value", - ZSTR_VAL(str), ZSTR_VAL(str)); + "Property %s:$%s of type %s cannot have a default value of null. " + "Use the nullable type ?%s to allow a null default value", + ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(str), ZSTR_VAL(str)); } else { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot use %s as default value for property %s::$%s of type %s", + "Property %s::$%s of type %s cannot have a default value of type %s", zend_zval_type_name(&value_zv), ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(str)); } @@ -7074,14 +7092,31 @@ void zend_compile_prop_group(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_check_const_and_trait_alias_attr(uint32_t attr, const char* entity) /* {{{ */ +static void zend_check_trait_alias_attr(uint32_t attr) /* {{{ */ +{ + if (attr & ZEND_ACC_STATIC) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"static\" as a trait method alias"); + } else if (attr & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"abstract\" as a trait method alias"); + } else if (attr & ZEND_ACC_FINAL) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"final\" as a trait method alias"); + } +} + +static void zend_check_const_attr(uint32_t attr, zend_string *class_name, zend_string *entity_name) /* {{{ */ { if (attr & ZEND_ACC_STATIC) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as %s modifier", entity); + zend_error_noreturn(E_COMPILE_ERROR, "Constant %s::%s cannot be declared static", + ZSTR_VAL(class_name), ZSTR_VAL(entity_name) + ); } else if (attr & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'abstract' as %s modifier", entity); + zend_error_noreturn(E_COMPILE_ERROR, "Constant %s::%s cannot be declared abstract", + ZSTR_VAL(class_name), ZSTR_VAL(entity_name) + ); } else if (attr & ZEND_ACC_FINAL) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'final' as %s modifier", entity); + zend_error_noreturn(E_COMPILE_ERROR, "Constant %s::%s cannot be declared final", + ZSTR_VAL(class_name), ZSTR_VAL(entity_name) + ); } } /* }}} */ @@ -7093,7 +7128,7 @@ void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_ast *attr uint32_t i, children = list->children; if ((ce->ce_flags & ZEND_ACC_TRAIT) != 0) { - zend_error_noreturn(E_COMPILE_ERROR, "Traits cannot have constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Trait %s cannot define constants", ZSTR_VAL(ce->name)); return; } @@ -7108,7 +7143,7 @@ void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_ast *attr zval value_zv; if (UNEXPECTED(flags & (ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_FINAL))) { - zend_check_const_and_trait_alias_attr(flags, "constant"); + zend_check_const_attr(flags, ce->name, name); } zend_const_expr_to_zval(&value_zv, value_ast_ptr); @@ -7174,7 +7209,7 @@ static void zend_compile_trait_alias(zend_ast *ast) /* {{{ */ zend_trait_alias *alias; - zend_check_const_and_trait_alias_attr(modifiers, "method"); + zend_check_trait_alias_attr(modifiers); alias = emalloc(sizeof(zend_trait_alias)); zend_compile_method_ref(method_ref_ast, &alias->trait_method); @@ -7302,8 +7337,7 @@ void zend_compile_class_decl(znode *result, zend_ast *ast, zend_bool toplevel) / zend_string *import_name = zend_hash_find_ptr_lc(FC(imports), unqualified_name); if (import_name && !zend_string_equals_ci(lcname, import_name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s " - "because the name is already in use", ZSTR_VAL(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s has already been declared", ZSTR_VAL(name)); } } @@ -7483,15 +7517,15 @@ static char *zend_get_use_type_str(uint32_t type) /* {{{ */ { switch (type) { case ZEND_SYMBOL_CLASS: - return ""; + return "class"; case ZEND_SYMBOL_FUNCTION: - return " function"; + return "function"; case ZEND_SYMBOL_CONST: - return " const"; + return "constant"; EMPTY_SWITCH_DEFAULT_CASE() } - return " unknown"; + ZEND_UNREACHABLE(); } /* }}} */ @@ -7501,8 +7535,8 @@ static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend return; } - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use%s %s as %s because the name " - "is already in use", zend_get_use_type_str(type), ZSTR_VAL(old_name), ZSTR_VAL(new_name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot import %s %s as %s, %s has already been declared", + zend_get_use_type_str(type), ZSTR_VAL(old_name), ZSTR_VAL(new_name), ZSTR_VAL(new_name)); } /* }}} */ @@ -7534,8 +7568,7 @@ void zend_compile_use(zend_ast *ast) /* {{{ */ new_name = zend_string_copy(old_name); if (!current_ns) { - zend_error(E_WARNING, "The use statement with non-compound name '%s' " - "has no effect", ZSTR_VAL(new_name)); + zend_error(E_WARNING, "Importing the global symbol %s has no effect in the global scope", ZSTR_VAL(new_name)); } } } @@ -7547,8 +7580,8 @@ void zend_compile_use(zend_ast *ast) /* {{{ */ } if (type == ZEND_SYMBOL_CLASS && zend_is_reserved_class_name(new_name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' " - "is a special class name", ZSTR_VAL(old_name), ZSTR_VAL(new_name), ZSTR_VAL(new_name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot import class %s as \"%s\", %s is a reserved class nam", + ZSTR_VAL(old_name), ZSTR_VAL(new_name), ZSTR_VAL(new_name)); } if (current_ns) { @@ -7569,8 +7602,9 @@ void zend_compile_use(zend_ast *ast) /* {{{ */ zend_string_addref(old_name); old_name = zend_new_interned_string(old_name); if (!zend_hash_add_ptr(current_import, lookup_name, old_name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use%s %s as %s because the name " - "is already in use", zend_get_use_type_str(type), ZSTR_VAL(old_name), ZSTR_VAL(new_name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot import %s %s as %s, %s has already been declared", + zend_get_use_type_str(type), ZSTR_VAL(old_name), ZSTR_VAL(new_name), ZSTR_VAL(new_name) + ); } zend_string_release_ex(lookup_name, 0); @@ -7618,7 +7652,9 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */ if (zend_get_special_const(ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name))) { zend_error_noreturn(E_COMPILE_ERROR, - "Cannot redeclare constant '%s'", ZSTR_VAL(unqualified_name)); + "Constant \"%s\" cannot be declared, %s is a reserved constant name", + ZSTR_VAL(unqualified_name), ZSTR_VAL(unqualified_name) + ); } name = zend_prefix_with_ns(unqualified_name); @@ -7627,8 +7663,7 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */ if (FC(imports_const)) { zend_string *import_name = zend_hash_find_ptr(FC(imports_const), unqualified_name); if (import_name && !zend_string_equals(import_name, name)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare const %s because " - "the name is already in use", ZSTR_VAL(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Constant %s has already been declared", ZSTR_VAL(name)); } } @@ -7683,7 +7718,7 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */ name = zend_ast_get_str(name_ast); if (zend_string_equals_literal_ci(name, "namespace")) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", ZSTR_VAL(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"%s\" as namespace name", ZSTR_VAL(name)); } FC(current_namespace) = zend_string_copy(name); @@ -8030,7 +8065,7 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ zend_hash_update(Z_ARRVAL_P(result), ZSTR_EMPTY_ALLOC(), value); break; default: - zend_error_noreturn(E_COMPILE_ERROR, "Illegal offset type"); + zend_error_noreturn(E_COMPILE_ERROR, "Illegal array key type: %s", zend_zval_type_name(key)); break; } } else if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), value)) { @@ -8692,7 +8727,7 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */ } else { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression " - "(you can use \"null !== expression\" instead)"); + "(you can use \"expression !== null\" instead)"); } } @@ -8953,7 +8988,7 @@ void zend_compile_class_name(znode *result, zend_ast *ast) /* {{{ */ if (expr_node.op_type == IS_CONST) { /* Unlikely case that happen if class_ast is constant folded. * Handle it here, to avoid needing a CONST specialization in the VM. */ - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"::class\" on value of type %s", + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"::class\" on a value of type %s", zend_zval_type_name(&expr_node.u.constant)); } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 1cec01591e990..7646b5ef041b7 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1237,9 +1237,9 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(v zend_throw_error(NULL, "Cannot use object as array"); } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_offset(void) +static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_offset(zval *key) { - zend_type_error("Illegal offset type"); + zend_type_error("Illegal array key type: %s", zend_zval_type_name(key)); } static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_string_offset(const zval *offset) @@ -2037,7 +2037,7 @@ static zend_never_inline zend_uchar slow_index_convert(HashTable *ht, const zval value->lval = 1; return IS_LONG; default: - zend_illegal_offset(); + zend_illegal_offset(dim); return IS_NULL; } } @@ -2597,7 +2597,7 @@ static zend_never_inline zend_bool ZEND_FASTCALL zend_array_key_exists_fast(Hash str = ZSTR_EMPTY_ALLOC(); goto str_key; } else { - zend_illegal_offset(); + zend_illegal_offset(key); return 0; } } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index cff1012acae92..1c67230e7a2ae 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5920,7 +5920,7 @@ ZEND_VM_C_LABEL(num_index): str = ZSTR_EMPTY_ALLOC(); ZEND_VM_C_GOTO(str_index); } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } FREE_OP2(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 1786cfcc83a91..cbcfd80792a0d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -6922,7 +6922,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -9078,7 +9078,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_T str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); @@ -9996,7 +9996,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_U str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -11460,7 +11460,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -19383,7 +19383,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CON str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -19786,7 +19786,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); @@ -20246,7 +20246,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNU str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -20645,7 +20645,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_ str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -24264,7 +24264,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CON str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -26417,7 +26417,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); @@ -28276,7 +28276,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNU str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -30431,7 +30431,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_ str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -41695,7 +41695,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONS str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -45141,7 +45141,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPV str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); @@ -46881,7 +46881,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUS str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } @@ -50264,7 +50264,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_H str = ZSTR_EMPTY_ALLOC(); goto str_index; } else { - zend_illegal_offset(); + zend_illegal_offset(offset); zval_ptr_dtor_nogc(expr_ptr); } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index d1957521c04cc..462982ad84c7a 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6389,7 +6389,7 @@ ZEND_METHOD(ReflectionAttribute, newInstance) zend_string *location = zend_get_attribute_target_names(attr->target); zend_string *allowed = zend_get_attribute_target_names(flags); - zend_throw_error(NULL, "Attribute \"%s\" cannot target %s (allowed targets: %s)", + zend_throw_error(NULL, "Attribute %s cannot target %s (allowed targets: %s)", ZSTR_VAL(attr->data->name), ZSTR_VAL(location), ZSTR_VAL(allowed) ); diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 3942366fa0fdb..efbe38ddb6412 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -375,7 +375,7 @@ static zval *spl_array_get_dimension_ptr(int check_inherited, spl_array_object * ZVAL_DEREF(offset); goto try_again; default: - zend_type_error("Illegal offset type"); + zend_type_error("Illegal array key type: %s", zend_zval_type_name(offset)); return (type == BP_VAR_W || type == BP_VAR_RW) ? &EG(error_zval) : &EG(uninitialized_zval); } @@ -499,7 +499,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zend_object *objec ZVAL_DEREF(offset); goto try_again; default: - zend_type_error("Illegal offset type"); + zend_type_error("Illegal array key type: %s", zend_zval_type_name(offset)); zval_ptr_dtor(value); return; } diff --git a/tests/classes/constants_visibility_005.phpt b/tests/classes/constants_visibility_005.phpt index ff5c10ca13e54..fc4edde5ca96c 100644 --- a/tests/classes/constants_visibility_005.phpt +++ b/tests/classes/constants_visibility_005.phpt @@ -7,4 +7,4 @@ class A { } ?> --EXPECTF-- -Fatal error: Cannot use 'static' as constant modifier in %s on line 3 +Fatal error: Constant A::X cannot be declared static in %s on line %d diff --git a/tests/classes/constants_visibility_006.phpt b/tests/classes/constants_visibility_006.phpt index 46300abf40600..b19912bb488ee 100644 --- a/tests/classes/constants_visibility_006.phpt +++ b/tests/classes/constants_visibility_006.phpt @@ -7,4 +7,4 @@ class A { } ?> --EXPECTF-- -Fatal error: Cannot use 'abstract' as constant modifier in %s on line 3 +Fatal error: Constant A::X cannot be declared abstract in %s on line %d diff --git a/tests/classes/constants_visibility_007.phpt b/tests/classes/constants_visibility_007.phpt index 37b52855869a1..e7dda5d5e2c32 100644 --- a/tests/classes/constants_visibility_007.phpt +++ b/tests/classes/constants_visibility_007.phpt @@ -7,4 +7,4 @@ class A { } ?> --EXPECTF-- -Fatal error: Cannot use 'final' as constant modifier in %s on line 3 +Fatal error: Constant A::X cannot be declared final in %s on line %d diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt index d44b497ca4f16..d2116e4cc7e35 100644 --- a/tests/classes/interface_member.phpt +++ b/tests/classes/interface_member.phpt @@ -8,4 +8,4 @@ interface if_a { } ?> --EXPECTF-- -Fatal error: Interfaces may not include member variables in %s on line %d +Fatal error: Interface if_a cannot have properties in %s on line %d diff --git a/tests/classes/interface_method.phpt b/tests/classes/interface_method.phpt index 04e2953676fab..60e9489b2c001 100644 --- a/tests/classes/interface_method.phpt +++ b/tests/classes/interface_method.phpt @@ -9,4 +9,4 @@ interface if_a { ?> --EXPECTF-- -Fatal error: Interface function if_a::err() cannot contain body %s on line %d +Fatal error: Interface method if_a::err() cannot have a body in %s on line %d diff --git a/tests/classes/interface_method_private.phpt b/tests/classes/interface_method_private.phpt index 4661a8637581b..9bede3dfc3876 100644 --- a/tests/classes/interface_method_private.phpt +++ b/tests/classes/interface_method_private.phpt @@ -9,4 +9,4 @@ interface if_a { ?> --EXPECTF-- -Fatal error: Access type for interface method if_a::err() must be omitted in %s on line %d +Fatal error: Interface method if_a::err() must have public visibility in %s on line %d diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt index abf41f97cdaca..c264dfecfdf53 100644 --- a/tests/classes/tostring_001.phpt +++ b/tests/classes/tostring_001.phpt @@ -118,7 +118,7 @@ test2::__toString() Converted ====test7==== test2::__toString() -Illegal offset type +Illegal array key type: test2 ====test8==== test2::__toString() string(9) "Converted"