diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d4e7f4be7e3..39c0fa035da 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1678,14 +1678,14 @@ ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table, ce = *pce; } - ce->refcount++; - zend_do_inheritance(ce, parent_ce); if (strchr(opline->op2.u.constant.value.str.val, ':')) { return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce); } + ce->refcount++; + /* Register the derived class */ if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) { zend_error(E_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);