From: Bob Weinand Date: Tue, 18 Oct 2016 12:32:12 +0000 (+0200) Subject: Merge branch 'PHP-7.1' X-Git-Tag: php-7.2.0alpha1~1091 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b246e2e38e1df9fe4611e3e6ba02a0f78cc700d;p=php Merge branch 'PHP-7.1' --- 2b246e2e38e1df9fe4611e3e6ba02a0f78cc700d diff --cc Zend/zend_vm_def.h index c5dc3256a0,78342a0636..f47fd2d246 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@@ -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; diff --cc Zend/zend_vm_execute.h index 61e63fad46,a8a0466b5a..bdc3731262 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@@ -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;