From: Dmitry Stogov Date: Tue, 10 Mar 2015 15:50:07 +0000 (+0300) Subject: Prevent possible double inheritance (ext/opcache/tests/bug67215.phpt) X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~717 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a53d82daa6d8de6e020a656b9b275a0b5dbcde4c;p=php Prevent possible double inheritance (ext/opcache/tests/bug67215.phpt) --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2a428fcc8a..f2de2c74d8 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -975,6 +975,10 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array return NULL; } + if (zend_hash_exists(class_table, Z_STR_P(op2))) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name->val); + } + zend_do_inheritance(ce, parent_ce); ce->refcount++;