From: Xinchen Hui Date: Thu, 14 Jul 2016 05:38:27 +0000 (+0800) Subject: Merge branch 'PHP-7.0' X-Git-Tag: php-7.1.0beta1~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efdc8ccd52203bff753fc786a3f2b09f6fcdf452;p=php Merge branch 'PHP-7.0' * PHP-7.0: Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals) Conflicts: Zend/zend_compile.c --- efdc8ccd52203bff753fc786a3f2b09f6fcdf452 diff --cc Zend/zend_compile.c index c6eb087edd,73ccd4a174..9a4ff33950 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@@ -5931,7 -5297,17 +5931,15 @@@ void zend_compile_class_decl(zend_ast * opline->opcode = ZEND_DECLARE_ANON_CLASS; } - zend_hash_update_ptr(CG(class_table), lcname, ce); - opline->op1_type = IS_UNUSED; - + if (!zend_hash_exists(CG(class_table), lcname)) { + zend_hash_add_ptr(CG(class_table), lcname, ce); + } else { + /* this anonymous class has been included */ + zval zv; + ZVAL_PTR(&zv, ce); + destroy_zend_class(&zv); + return; + } } else { zend_string *key;