From 5d160e309ed207e618d49029e51c9c2dc2c5e61c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 17 Feb 2021 10:47:30 +0100 Subject: Fix static variable behavior with inheritance When a method is inherited, the static variables will now always use the initial values, rather than the values at the time of inheritance. As such, behavior no longer depends on whether inheritance happens before or after a method has been called. This is implemented by always keeping static_variables as the original values, and static_variables_ptr as the modified copy. Closes GH-6705. --- ext/reflection/php_reflection.c | 1 - 1 file changed, 1 deletion(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 2f1a358518..bd487972ec 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1796,7 +1796,6 @@ ZEND_METHOD(ReflectionFunctionAbstract, getStaticVariables) array_init(return_value); ht = ZEND_MAP_PTR_GET(fptr->op_array.static_variables_ptr); if (!ht) { - ZEND_ASSERT(fptr->op_array.fn_flags & ZEND_ACC_IMMUTABLE); ht = zend_array_dup(fptr->op_array.static_variables); ZEND_MAP_PTR_SET(fptr->op_array.static_variables_ptr, ht); } -- cgit v1.2.1