Skip to content

Review the usage of apostrophes in error messages #5590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Zend/tests/018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var_dump(constant("TEST_CONST2"));
echo "Done\n";
?>
--EXPECT--
Undefined constant ''
Undefined constant ""
int(1)
string(4) "test"
Done
8 changes: 4 additions & 4 deletions Zend/tests/024.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ NULL
Warning: Undefined variable $b in %s on line %d
int(1)

Warning: Attempt to read property '1' on int in %s on line %d
Warning: Attempt to read property "1" on int in %s on line %d
NULL

Warning: Attempt to read property '1' on int in %s on line %d
Warning: Attempt to read property "1" on int in %s on line %d
NULL

Warning: Undefined variable $c in %s on line %d

Warning: Trying to access array offset on value of type null in %s on line %d

Warning: Attempt to read property '1' on int in %s on line %d
Warning: Attempt to read property "1" on int in %s on line %d

Warning: Attempt to read property '' on null in %s on line %d
Warning: Attempt to read property "" on null in %s on line %d
NULL
4 changes: 2 additions & 2 deletions Zend/tests/026.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ print "ok\n";

?>
--EXPECTF--
Warning: Attempt to read property 'a' on null in %s on line %d
Warning: Attempt to read property "a" on null in %s on line %d
ok
Attempt to assign property 'a' on null
Attempt to assign property "a" on null
ok
2 changes: 1 addition & 1 deletion Zend/tests/028.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bool(true)
bool(true)
bool(true)

Notice: Undefined offset: 2 in %s on line %d
Notice: Undefined array key 2 in %s on line %d

Fatal error: Uncaught Error: Value of type null is not callable in %s:%d
Stack trace:
Expand Down
6 changes: 3 additions & 3 deletions Zend/tests/033.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ Warning: Trying to access array offset on value of type null in %s on line %d

Warning: Trying to access array offset on value of type null in %s on line %d

Warning: Attempt to read property 'foo' on null in %s on line %d
Attempt to assign property 'foo' on null
Attempt to assign property 'bar' on null
Warning: Attempt to read property "foo" on null in %s on line %d
Attempt to assign property "foo" on null
Attempt to assign property "bar" on null
2 changes: 1 addition & 1 deletion Zend/tests/037.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var_dump($x::$x);
--EXPECTF--
int(1)

Fatal error: Uncaught Error: Access to undeclared static property: Closure::$x in %s:%d
Fatal error: Uncaught Error: Access to undeclared static property Closure::$x in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/access_modifiers_008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ B2::test();

?>
--EXPECTF--
Fatal error: Call to protected method B1::f() from context 'B2' in %s on line %d
Fatal error: Call to protected method B1::f() from scope B2 in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/access_modifiers_009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ B2::test();
--EXPECTF--
bool(false)

Fatal error: Call to protected method B1::f() from context 'B2' in %s on line %d
Fatal error: Call to protected method B1::f() from scope B2 in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/access_modifiers_010.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ new c;

?>
--EXPECTF--
Fatal error: Uncaught Error: Call to private method d::test2() from context 'a' in %s:%d
Fatal error: Uncaught Error: Call to private method d::test2() from scope a in %s:%d
Stack trace:
#0 %s(%d): a->test()
#1 %s(%d): c->__construct()
Expand Down
8 changes: 4 additions & 4 deletions Zend/tests/array_offset.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Ensure "undefined offset" notice formats message correctly when undefined key is
echo "Done\n";
?>
--EXPECTF--
Notice: Undefined offset: -1 in %s on line 3
Notice: Undefined array key -1 in %s on line %d

Notice: Undefined offset: -1 in %s on line 4
Notice: Undefined array key -1 in %s on line %d

Notice: Undefined offset: -1 in %s on line 5
Notice: Undefined array key -1 in %s on line 5

Notice: Undefined offset: -1 in %s on line 6
Notice: Undefined array key -1 in %s on line 6
Done
2 changes: 1 addition & 1 deletion Zend/tests/array_unpack/classes.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ array(3) {
[2]=>
int(3)
}
Exception: Cannot declare self-referencing constant 'self::B'
Exception: Cannot declare self-referencing constant self::B
4 changes: 2 additions & 2 deletions Zend/tests/assign_dim_obj_null_return.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ Cannot add element to the array as the next element is already occupied
Illegal offset type
Illegal offset type
Cannot use a scalar value as an array
Attempt to assign property 'foo' on bool
Attempt to assign property 'foo' on bool
Attempt to assign property "foo" on bool
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've just realized that for bad array containers, we use on value of type %s instead of on %s. I'm not sure which format is preferred, but personally I find the former more accurate.

Attempt to assign property "foo" on bool
5 changes: 2 additions & 3 deletions Zend/tests/attributes/003_ast_nodes.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,5 @@ array(1) {
}

int(1)
string(30) "Class 'MissingClass' not found"
string(30) "Class 'MissingClass' not found"

string(30) "Class "MissingClass" not found"
string(30) "Class "MissingClass" not found"
8 changes: 4 additions & 4 deletions Zend/tests/attributes/005_objects.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ string(7) "ERROR 2"
string(74) "A1::__construct(): Argument #1 ($name) must be of type string, array given"

string(7) "ERROR 3"
string(30) "Attribute class 'A2' not found"
string(30) "Attribute class "A2" not found"

string(7) "ERROR 4"
string(50) "Attribute constructor of class 'A3' must be public"
string(48) "Attribute constructor of class A3 must be public"

string(7) "ERROR 5"
string(71) "Attribute class 'A4' does not have a constructor, cannot pass arguments"
string(69) "Attribute class A4 does not have a constructor, cannot pass arguments"

string(7) "ERROR 6"
string(55) "Attempting to use non-attribute class 'A5' as attribute"
string(55) "Attempting to use non-attribute class "A5" as attribute"
2 changes: 1 addition & 1 deletion Zend/tests/attributes/006_filter.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ Array
string(7) "ERROR 1"
string(103) "ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag"
string(7) "ERROR 2"
string(34) "Class 'SomeMissingClass' not found"
string(34) "Class "SomeMissingClass" not found"
4 changes: 2 additions & 2 deletions Zend/tests/attributes/013_class_scope.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait T1
class C2
{
use T1;

private const FOO = 'bar';
}

Expand Down Expand Up @@ -109,7 +109,7 @@ Array
[1] => bar
)
string(7) "ERROR 1"
string(36) "Undefined class constant 'self::FOO'"
string(28) "Undefined constant self::FOO"

bool(true)
string(3) "bar"
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/attributes/023_ast_node_in_validation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ class A1 { }

?>
--EXPECTF--
Fatal error: Class 'Foo' not found in %s
Fatal error: Class "Foo" not found in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug29015.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object(stdClass)#1 (1) {
string(10) "string('')"
}

Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
Fatal error: Uncaught Error: Cannot access property starting with "\0" in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug29883.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bool(false)
bool(true)
bool(true)

Warning: Uninitialized string offset: -10 in %s on line %d
Warning: Uninitialized string offset -10 in %s on line %d
string(0) ""
string(1) "u"
string(1) "u"
2 changes: 1 addition & 1 deletion Zend/tests/bug30519.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class test implements a {
}
?>
--EXPECTF--
Fatal error: Uncaught Error: Interface 'a' not found in %s:%d
Fatal error: Uncaught Error: Interface "a" not found in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug30922.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var_dump($a instanceOf A);
echo "ok\n";
?>
--EXPECTF--
Fatal error: Uncaught Error: Interface 'RecurisiveFooFar' not found in %s:%d
Fatal error: Uncaught Error: Interface "RecurisiveFooFar" not found in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
6 changes: 3 additions & 3 deletions Zend/tests/bug31098.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ ok
ok
ok

Warning: Attempt to read property 'wrong' on string in %s on line %d
Warning: Attempt to read property "wrong" on string in %s on line %d
ok

Warning: Illegal string offset 'wrong' in %s on line %d
Warning: Illegal string offset "wrong" in %s on line %d
ok
ok

Warning: Illegal string offset 'wrong' in %s on line %d
Warning: Illegal string offset "wrong" in %s on line %d
ok
2 changes: 1 addition & 1 deletion Zend/tests/bug31102.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Caught: Test1::__construct
Caught: {closure}
{closure}(Test3,3)

Fatal error: Uncaught Error: Class 'Test3' not found in %sbug31102.php(%d) : eval()'d code:1
Fatal error: Uncaught Error: Class "Test3" not found in %s:%d
Stack trace:
#0 %s(%d): eval()
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug37632.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ B2::doTest
C2::test
B4::doTest

Fatal error: Uncaught Error: Call to protected C4::__construct() from context 'B4' in %sbug37632.php:%d
Fatal error: Uncaught Error: Call to protected C4::__construct() from scope B4 in %s:%d
Stack trace:
#0 %s(%d): B4::doTest()
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug37667.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var_dump($obj);
--EXPECTF--
string(3) "bar"

Notice: Undefined offset: 2 in %sbug37667.php on line 16
Notice: Undefined array key 2 in %s on line %d
NULL
object(Test)#%d (1) {
["property":protected]=>
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug37811.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ string(3) "Foo"

Warning: Constants may only evaluate to scalar values, arrays or resources in %sbug37811.php on line %d

Fatal error: Uncaught Error: Undefined constant 'Baz' in %s:%d
Fatal error: Uncaught Error: Undefined constant "Baz" in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
26 changes: 13 additions & 13 deletions Zend/tests/bug39018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -64,39 +64,39 @@ print "\nDone\n";
--EXPECTF--
Warning: String offset cast occurred in %s on line %d

Warning: Uninitialized string offset: %s in %s on line %d
Warning: Uninitialized string offset %d in %s on line %d

Warning: Uninitialized string offset: 0 in %s on line %d
Warning: Uninitialized string offset 0 in %s on line %d

Warning: Uninitialized string offset: 0 in %s on line %d
Warning: Uninitialized string offset 0 in %s on line %d

Warning: String offset cast occurred in %s on line %d

Warning: Uninitialized string offset: %i in %s on line %d
Warning: Uninitialized string offset -%d in %s on line %d

Warning: String offset cast occurred in %s on line %d

Warning: Uninitialized string offset: %i in %s on line %d
Warning: Uninitialized string offset -%d in %s on line %d

Warning: Uninitialized string offset: 0 in %s on line %d
Warning: Uninitialized string offset 0 in %s on line %d

Warning: Uninitialized string offset: 4 in %s on line %d
Warning: Uninitialized string offset 4 in %s on line %d

Warning: Uninitialized string offset: 4 in %s on line %d
Warning: Uninitialized string offset 4 in %s on line %d

Warning: Uninitialized string offset: 4 in %s on line %d
Warning: Uninitialized string offset 4 in %s on line %d

Warning: Uninitialized string offset: 4 in %s on line %d
Warning: Uninitialized string offset 4 in %s on line %d

Warning: Uninitialized string offset: 4 in %s on line %d
Warning: Uninitialized string offset 4 in %s on line %d

Warning: String offset cast occurred in %s on line %d

Warning: Uninitialized string offset: 12 in %s on line %d
Warning: Uninitialized string offset 12 in %s on line %d

Warning: String offset cast occurred in %s on line %d

Warning: Uninitialized string offset: 12 in %s on line %d
Warning: Uninitialized string offset 12 in %s on line %d

Warning: String offset cast occurred in %s on line %d

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug39304.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Bug #39304 (Segmentation fault with list unpacking of string offset)
var_dump($a,$b);
?>
--EXPECTF--
Warning: Uninitialized string offset: 0 in %s on line %d
Warning: Uninitialized string offset 0 in %s on line %d
NULL
NULL
2 changes: 1 addition & 1 deletion Zend/tests/bug41633_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Foo {
echo Foo::A."\n";
?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined class constant 'self::B' in %sbug41633_2.php:5
Fatal error: Uncaught Error: Undefined constant self::B in %s:%d
Stack trace:
#0 {main}
thrown in %sbug41633_2.php on line 5
2 changes: 1 addition & 1 deletion Zend/tests/bug41633_3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Foo {
echo Foo::A;
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot declare self-referencing constant 'Foo::B' in %sbug41633_3.php:%d
Fatal error: Uncaught Error: Cannot declare self-referencing constant Foo::B in %s:%d
Stack trace:
#0 {main}
thrown in %sbug41633_3.php on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug42819.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Array
[1] => 1
)

Fatal error: Uncaught Error: Undefined constant 'foo\foo\unknown' in %sbug42819.php:%d
Fatal error: Uncaught Error: Undefined constant "foo\foo\unknown" in %s:%d
Stack trace:
#0 %s(%d): foo\oops()
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug42937.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test3
test4
test5

Fatal error: Uncaught Error: Call to undefined method C::test6() in %sbug42937.php:21
Fatal error: Uncaught Error: Call to undefined method C::test6() in %s:%d
Stack trace:
#0 %s(%d): B->test()
#1 {main}
Expand Down
8 changes: 4 additions & 4 deletions Zend/tests/bug43344_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ try {

?>
--EXPECT--
Undefined constant 'Foo\bar'
Undefined constant 'Foo\bar'
Undefined constant 'Foo\bar'
Undefined constant 'Foo\bar'
Undefined constant "Foo\bar"
Undefined constant "Foo\bar"
Undefined constant "Foo\bar"
Undefined constant "Foo\bar"
2 changes: 1 addition & 1 deletion Zend/tests/bug43344_10.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Bug #43344.10 (Wrong error message for undefined namespace constant)
echo namespace\bar."\n";
?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant 'bar' in %sbug43344_10.php:%d
Fatal error: Uncaught Error: Undefined constant "bar" in %s:%d
Stack trace:
#0 {main}
thrown in %sbug43344_10.php on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug43344_11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function f($a=namespace\bar) {
echo f()."\n";
?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant 'bar' in %sbug43344_11.php:%d
Fatal error: Uncaught Error: Undefined constant "bar" in %s:%d
Stack trace:
#0 %s(%d): f()
#1 {main}
Expand Down
Loading