diff options
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r-- | Zend/zend_execute.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 539b1e4dd7..00a68613fc 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1166,6 +1166,12 @@ static zend_always_inline HashTable *zend_get_target_symbol_table(zend_execute_d } else if (EXPECTED(fetch_type == ZEND_FETCH_STATIC)) { ZEND_ASSERT(EX(func)->op_array.static_variables != NULL); ht = EX(func)->op_array.static_variables; + if (GC_REFCOUNT(ht) > 1) { + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_REFCOUNT(ht)--; + } + EX(func)->op_array.static_variables = ht = zend_array_dup(ht); + } } else { ZEND_ASSERT(fetch_type == ZEND_FETCH_LOCAL); if (!EX(symbol_table)) { |