Allow arbitrary expressions in static variable initializer

Closes GH-9301
This commit is contained in:
Ilija Tovilo 2022-08-11 17:42:54 +02:00
parent 3189a9f94a
commit 0b1d750d91
No known key found for this signature in database
GPG key ID: A4F5D403F118200A
44 changed files with 1118 additions and 690 deletions

View file

@ -1949,7 +1949,6 @@ ZEND_METHOD(ReflectionFunctionAbstract, getStaticVariables)
{
reflection_object *intern;
zend_function *fptr;
zval *val;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
@ -1966,11 +1965,6 @@ ZEND_METHOD(ReflectionFunctionAbstract, getStaticVariables)
ht = zend_array_dup(fptr->op_array.static_variables);
ZEND_MAP_PTR_SET(fptr->op_array.static_variables_ptr, ht);
}
ZEND_HASH_MAP_FOREACH_VAL(ht, val) {
if (UNEXPECTED(zval_update_constant_ex(val, fptr->common.scope) != SUCCESS)) {
RETURN_THROWS();
}
} ZEND_HASH_FOREACH_END();
zend_hash_copy(Z_ARRVAL_P(return_value), ht, zval_add_ref);
} else {
RETURN_EMPTY_ARRAY();