]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0'
authorXinchen Hui <laruence@gmail.com>
Thu, 14 Jul 2016 05:38:27 +0000 (13:38 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 14 Jul 2016 05:38:27 +0000 (13:38 +0800)
* PHP-7.0:
  Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals)

Conflicts:
Zend/zend_compile.c

1  2 
Zend/zend_compile.c

index c6eb087eddc29ac24b0e1ff7f8c0104a6c976cc5,73ccd4a174c12be16e4b4efb3442c7ec27b883f5..9a4ff33950b18c4c777b8bc57adef049f2e902a5
@@@ -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;