Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/tests/034.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/036.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ try {

?>
--EXPECT--
Illegal offset type
Illegal array key type: Closure
Copy link
Member Author

@kocsismate kocsismate Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a similar compile-time error message, so I decided to also change the run-time ones as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, leaving the : felt a little bit weird for me, but I'm ok to do so for consistency with other messages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that consistent with other messages though? I would expect this to be something like Illegal array key of type Closure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not exactly. And the Illegal array key of type Closure format is the best; unfortunately, it didn't come to my mind :)

Speaking about which branch to target: I was also unsure which branch to use. I first thought that the changes won't be very offensive, but it turned out that they are, so I agree, let's instead go for PHP 8.1.

2 changes: 1 addition & 1 deletion Zend/tests/038.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ try {

?>
--EXPECT--
Illegal offset type
Illegal array key type: Closure
2 changes: 1 addition & 1 deletion Zend/tests/assign_coalesce_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions Zend/tests/assign_dim_obj_null_return.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/attributes/008_wrong_attribution.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/attributes/024_internal_target_validation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/break_error_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

@kocsismate kocsismate Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second half of the change is for consistency with the value error messages, but I don't insist on it too much in this case.

2 changes: 1 addition & 1 deletion Zend/tests/break_error_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/break_error_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/break_error_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug42859.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I normalized the different error messages related to the use statement to use import. i think this change doesn't make them significantly less clear, but I felt that they are a bit more "smooth". So all in all, I don't mind whichever expression we end up with.

2 changes: 1 addition & 1 deletion Zend/tests/bug43332_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug69092.2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug69388.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug69388_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug69805.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug70240.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug71871.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug71871_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug72441.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug77660.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/bug79790.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug79947.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ try {
var_dump($array);
?>
--EXPECT--
Illegal offset type
Illegal array key type: array
array(0) {
}
2 changes: 1 addition & 1 deletion Zend/tests/call_user_func_005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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]=>
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/catch_static.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/class_name_as_scalar_error_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/class_on_constant_evaluated_expression.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/class_uses_static.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/ctor_promotion_free_function.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/ctor_promotion_not_a_ctor.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Zend/tests/declare_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Zend/tests/declare_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/declare_already_in_use.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/duplicate_label_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_011.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_026.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_028.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_029.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_030.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_031.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_035.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_036.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_037.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_038.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/errmsg_039.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/function_redecl.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/increment_function_return_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/inter_06.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

@kocsismate kocsismate Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if the the name is already in use part adds any useful context to the messages, so I got rid of it :) With the new format, it is slightly annoying that the symbol type doesn't start with a capitalized letter.

2 changes: 1 addition & 1 deletion Zend/tests/interface_extends_static.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/tests/isset_expr_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got rid of the Yoda-style condition, because is not the primary style, as far as I noticed so far (thankfully :D)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super fan of the usage of you from the original message. Maybe something like:

Suggested change
Fatal error: Cannot use isset() on the result of an expression (you can use "expression !== null" instead) in %s on line %d
Fatal error: Cannot use isset() on the result of an expression ("expression !== null" can be used instead) in %s on line %d

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This change makes sense for me!

2 changes: 1 addition & 1 deletion Zend/tests/isset_func_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading