Allow readonly properties to be reinitialized once during cloning (#10389)

RFC: https://wiki.php.net/rfc/readonly_amendments
This commit is contained in:
Máté Kocsis 2023-02-28 22:54:38 +01:00 committed by GitHub
parent b1ccbc8210
commit 3bcf2c3755
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 385 additions and 27 deletions

View file

@ -4224,6 +4224,10 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z
ce->ce_flags |= ZEND_ACC_HAS_TYPE_HINTS;
}
if (access_type & ZEND_ACC_READONLY) {
ce->ce_flags |= ZEND_ACC_HAS_READONLY_PROPS;
}
if (ce->type == ZEND_INTERNAL_CLASS) {
property_info = pemalloc(sizeof(zend_property_info), 1);
} else {