Skip to content

zend_resolve_const_class_name_reference(): use double quotes around names #15998

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

Merged
merged 1 commit into from
Sep 23, 2024
Merged
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/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, as it is reserved in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/errmsg_030.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
errmsg: cannot use 'self' as parent class name
errmsg: cannot use "self" as parent class name
--FILE--
<?php

Expand All @@ -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, as it is reserved in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/errmsg_031.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
errmsg: cannot use 'parent' as parent class name
errmsg: cannot use "parent" as parent class name
--FILE--
<?php

Expand All @@ -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, as it is reserved in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/errmsg_035.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
errmsg: cannot use 'self' as interface name
errmsg: cannot use "self" as interface name
--FILE--
<?php

Expand All @@ -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, as it is reserved in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/errmsg_036.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
errmsg: cannot use 'parent' as interface name
errmsg: cannot use "parent" as interface name
--FILE--
<?php

Expand All @@ -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, as it is reserved in %s on line %d
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, as it is reserved in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/lsb_006.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
ZE2 Late Static Binding ensuring extending 'static' is not allowed
ZE2 Late Static Binding ensuring extending "static" is not allowed
--FILE--
<?php

Expand All @@ -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, as it is reserved in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/lsb_007.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
ZE2 Late Static Binding ensuring implementing 'static' is not allowed
ZE2 Late Static Binding ensuring implementing "static" is not allowed
--FILE--
<?php

Expand All @@ -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, as it is reserved in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/static_in_trait_insteadof_list.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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, as it is reserved in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/static_in_trait_insteadof_reference.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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, as it is reserved in %s on line %d
2 changes: 1 addition & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ 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",
"Cannot use \"%s\" as %s, as it is reserved",
ZSTR_VAL(class_name), type);
}
return zend_resolve_class_name(class_name, ast->attr);
Expand Down
Loading