]> granicus.if.org Git - php/commitdiff
Port fix to 7.0
authorXinchen Hui <laruence@gmail.com>
Mon, 23 Nov 2015 10:31:56 +0000 (18:31 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 23 Nov 2015 10:31:56 +0000 (18:31 +0800)
NEWS
Zend/zend_compile.c

diff --git a/NEWS b/NEWS
index b3b2d5091a1873f81dcf744296f19209cc0efb94..8a0441d78c84e69a6412457b1b22215660f76378 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? ??? 2015, PHP 7.0.1
 
 - Core:
+  . Fixed bug #70958 (Invalid opcode while using ::class as trait method
+    paramater default value). (Laruence)
   . Fixed bug #70947 (INI parser segfault with INI_SCANNER_TYPED). (Laruence)
   . Fixed bug #70944 (try{ } finally{} can create infinite chains of
     exceptions). (Laruence)
index 75e484f1dd9a267de3b7ffefc547f86f138cbba5..b91fddeeb00eb948d560c01be1ea2ce47bfc9c63 100644 (file)
@@ -7472,10 +7472,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
 
                        if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
                                if (Z_TYPE(result) == IS_NULL) {
+                                       if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
+                                               zend_ast_destroy(ast);
+                                               *ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
+                                       }
                                        return;
-                               } else {
-                                       break;
                                }
+                               break;
                        }
 
                        zend_eval_const_expr(&class_ast);