De-duplicate readonly property modification error message (#14972)

This commit is contained in:
Ilija Tovilo 2024-07-16 16:29:40 +02:00 committed by GitHub
parent 551038bb16
commit a26ec58fa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 6 deletions

View file

@ -150,7 +150,7 @@ zval *xmlreader_write_property(zend_object *object, zend_string *name, zval *val
xmlreader_prop_handler *hnd = zend_hash_find_ptr(&xmlreader_prop_handlers, name);
if (hnd != NULL) {
zend_throw_error(NULL, "Cannot modify readonly property %s::$%s", ZSTR_VAL(object->ce->name), ZSTR_VAL(name));
zend_readonly_property_modification_error_ex(ZSTR_VAL(object->ce->name), ZSTR_VAL(name));
} else {
value = zend_std_write_property(object, name, value, cache_slot);
}