]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.1'
authorBob Weinand <bobwei9@hotmail.com>
Tue, 18 Oct 2016 12:32:12 +0000 (14:32 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Tue, 18 Oct 2016 12:32:12 +0000 (14:32 +0200)
1  2 
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index c5dc3256a0aafdca090a43f065d447990e55d3ba,78342a06369840fdb5c95079b064e484d6a1622c..f47fd2d2464ca6e52e4fa1f7c7c9ec4e0dc5901c
@@@ -3492,8 -3510,22 +3510,19 @@@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CAL
                func = fcc.function_handler;
                called_scope = fcc.called_scope;
                object = fcc.object;
+               if (error) {
+                       efree(error);
+                       /* This is the only soft error is_callable() can generate */
+                       zend_error(E_DEPRECATED,
+                               "Non-static method %s::%s() should not be called statically",
+                               ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
+                       if (UNEXPECTED(EG(exception) != NULL)) {
+                               FREE_OP2();
+                               HANDLE_EXCEPTION();
+                       }
+               }
                if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
                        /* Delay closure destruction until its invocation */
 -                      if (OP2_TYPE & (IS_VAR|IS_CV)) {
 -                              ZVAL_DEREF(function_name);
 -                      }
                        ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
                        GC_REFCOUNT((zend_object*)func->common.prototype)++;
                        call_info |= ZEND_CALL_CLOSURE;
index 61e63fad464866752d34617dc50a2a1f92f30494,a8a0466b5a5e70206fc49e4d236c7d2d89ebb142..bdc3731262f8012c69fc6aad4c90bce5ca2ee860
@@@ -5571,8 -5640,22 +5619,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS
                func = fcc.function_handler;
                called_scope = fcc.called_scope;
                object = fcc.object;
+               if (error) {
+                       efree(error);
+                       /* This is the only soft error is_callable() can generate */
+                       zend_error(E_DEPRECATED,
+                               "Non-static method %s::%s() should not be called statically",
+                               ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
+                       if (UNEXPECTED(EG(exception) != NULL)) {
+                               HANDLE_EXCEPTION();
+                       }
+               }
                if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
                        /* Delay closure destruction until its invocation */
 -                      if (IS_CONST & (IS_VAR|IS_CV)) {
 -                              ZVAL_DEREF(function_name);
 -                      }
                        ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
                        GC_REFCOUNT((zend_object*)func->common.prototype)++;
                        call_info |= ZEND_CALL_CLOSURE;
@@@ -9466,8 -9555,22 +9534,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS
                func = fcc.function_handler;
                called_scope = fcc.called_scope;
                object = fcc.object;
+               if (error) {
+                       efree(error);
+                       /* This is the only soft error is_callable() can generate */
+                       zend_error(E_DEPRECATED,
+                               "Non-static method %s::%s() should not be called statically",
+                               ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
+                       if (UNEXPECTED(EG(exception) != NULL)) {
+                               HANDLE_EXCEPTION();
+                       }
+               }
                if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
                        /* Delay closure destruction until its invocation */
 -                      if (IS_CV & (IS_VAR|IS_CV)) {
 -                              ZVAL_DEREF(function_name);
 -                      }
                        ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
                        GC_REFCOUNT((zend_object*)func->common.prototype)++;
                        call_info |= ZEND_CALL_CLOSURE;
@@@ -11425,8 -11534,22 +11513,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS
                func = fcc.function_handler;
                called_scope = fcc.called_scope;
                object = fcc.object;
+               if (error) {
+                       efree(error);
+                       /* This is the only soft error is_callable() can generate */
+                       zend_error(E_DEPRECATED,
+                               "Non-static method %s::%s() should not be called statically",
+                               ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
+                       if (UNEXPECTED(EG(exception) != NULL)) {
+                               zval_ptr_dtor_nogc(free_op2);
+                               HANDLE_EXCEPTION();
+                       }
+               }
                if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
                        /* Delay closure destruction until its invocation */
 -                      if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) {
 -                              ZVAL_DEREF(function_name);
 -                      }
                        ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
                        GC_REFCOUNT((zend_object*)func->common.prototype)++;
                        call_info |= ZEND_CALL_CLOSURE;