diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 222aaed0190..35bbd3c96cc 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4344,8 +4344,9 @@ static int accel_preload(const char *config) if (op_array->static_variables) { HashTable *ht = ZEND_MAP_PTR_GET(op_array->static_variables_ptr); if (ht) { - ZEND_ASSERT(GC_REFCOUNT(ht) == 1); - zend_array_destroy(ht); + if (GC_DELREF(ht) == 0) { + zend_array_destroy(ht); + } ZEND_MAP_PTR_SET(op_array->static_variables_ptr, NULL); } } diff --git a/ext/opcache/tests/preload_bug78175_2.inc b/ext/opcache/tests/preload_bug78175_2.inc index 288c1426788..a960e1b08ca 100644 --- a/ext/opcache/tests/preload_bug78175_2.inc +++ b/ext/opcache/tests/preload_bug78175_2.inc @@ -15,6 +15,9 @@ class Loader { } } +class ExtLoader extends Loader { +} + Loader::getLoader(); Loader::getCounter(); Loader::getCounter();