Remove special case for the error message of static properties in readonly classes

This commit is contained in:
Máté Kocsis 2022-05-23 09:44:40 +02:00
parent 85d41da32a
commit a3f8bb33cd
No known key found for this signature in database
GPG key ID: FD055E41728BF310
2 changed files with 1 additions and 7 deletions

View file

@ -10,4 +10,4 @@ readonly class Foo
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Readonly class Foo cannot declare static properties in %s on line %d Fatal error: Static property Foo::$bar cannot be readonly in %s on line %d

View file

@ -7256,12 +7256,6 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract"); zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract");
} }
if ((ce->ce_flags & ZEND_ACC_READONLY_CLASS) && (flags & ZEND_ACC_STATIC)) {
zend_error_noreturn(E_COMPILE_ERROR, "Readonly class %s cannot declare static properties",
ZSTR_VAL(ce->name)
);
}
for (i = 0; i < children; ++i) { for (i = 0; i < children; ++i) {
zend_property_info *info; zend_property_info *info;
zend_ast *prop_ast = list->child[i]; zend_ast *prop_ast = list->child[i];