Skip to content

Commit a3f8bb3

Browse files
committed
Remove special case for the error message of static properties in readonly classes
1 parent 85d41da commit a3f8bb3

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

Zend/tests/readonly_classes/readonly_class_property3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ readonly class Foo
1010

1111
?>
1212
--EXPECTF--
13-
Fatal error: Readonly class Foo cannot declare static properties in %s on line %d
13+
Fatal error: Static property Foo::$bar cannot be readonly in %s on line %d

Zend/zend_compile.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7256,12 +7256,6 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
72567256
zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract");
72577257
}
72587258

7259-
if ((ce->ce_flags & ZEND_ACC_READONLY_CLASS) && (flags & ZEND_ACC_STATIC)) {
7260-
zend_error_noreturn(E_COMPILE_ERROR, "Readonly class %s cannot declare static properties",
7261-
ZSTR_VAL(ce->name)
7262-
);
7263-
}
7264-
72657259
for (i = 0; i < children; ++i) {
72667260
zend_property_info *info;
72677261
zend_ast *prop_ast = list->child[i];

0 commit comments

Comments
 (0)