zend_detach_symbol_table(execute_data);
old_execute_data = EX(prev_execute_data);
while (old_execute_data) {
- if (old_execute_data->func && (old_execute_data->func->op_array.type == ZEND_USER_FUNCTION || old_execute_data->func->op_array.type == ZEND_EVAL_CODE)) {
+ if (old_execute_data->func && ZEND_USER_CODE(old_execute_data->func->op_array.type)) {
if (old_execute_data->symbol_table == symbol_table) {
zend_attach_symbol_table(old_execute_data);
}
static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes;
+ zend_uint op_num = EG(opline_before_exception) - EX(func)->op_array.opcodes;
int i;
zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0;
- for (i=0; i<EG(active_op_array)->last_try_catch; i++) {
- if (EG(active_op_array)->try_catch_array[i].try_op > op_num) {
+ for (i = 0; i < EX(func)->op_array.last_try_catch; i++) {
+ if (EX(func)->op_array.try_catch_array[i].try_op > op_num) {
/* further blocks will not be relevant... */
break;
}
- if (op_num < EG(active_op_array)->try_catch_array[i].catch_op) {
+ if (op_num < EX(func)->op_array.try_catch_array[i].catch_op) {
catch_op_num = EX(func)->op_array.try_catch_array[i].catch_op;
}
if (op_num < EX(func)->op_array.try_catch_array[i].finally_op) {
{
USE_OPLINE
zend_function *fbc;
- zend_class_entry *called_scope;
- zend_object *object;
- zval *function_name_ptr, *function_name, *func;
+ zval *function_name, *func;
if (IS_CONST == IS_CONST) {
- function_name_ptr = function_name = (zval*)(opline->op2.zv+1);
+ function_name = (zval*)(opline->op2.zv+1);
if (CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv))) {
fbc = CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv));
} else if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(function_name))) == NULL)) {
} else {
zend_string *lcname;
+ zend_class_entry *called_scope;
+ zend_object *object;
+ zval *function_name_ptr;
SAVE_OPLINE();
function_name_ptr = function_name = opline->op2.zv;
if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name));
}
+ fbc = Z_FUNC_P(func);
STR_FREE(lcname);
- EX(call) = zend_vm_stack_push_call_frame(
- Z_FUNC_P(func), opline->extended_value, 0, NULL, NULL, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_CONST != IS_CONST && IS_CONST != IS_TMP_VAR &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
} else {
}
-
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_CONST != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
}
}
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Function name must be a string");
- ZEND_VM_NEXT_OPCODE(); /* Never reached */
+ ZEND_VM_CONTINUE(); /* Never reached */
}
+ EX(call) = zend_vm_stack_push_call_frame(
+ fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
}
{
USE_OPLINE
zend_function *fbc;
- zend_class_entry *called_scope;
- zend_object *object;
- zval *function_name_ptr, *function_name, *func;
+ zval *function_name, *func;
if (IS_TMP_VAR == IS_CONST) {
- function_name_ptr = function_name = (zval*)(opline->op2.zv+1);
+ function_name = (zval*)(opline->op2.zv+1);
if (CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv))) {
fbc = CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv));
} else if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(function_name))) == NULL)) {
} else {
zend_string *lcname;
zend_free_op free_op2;
+ zend_class_entry *called_scope;
+ zend_object *object;
+ zval *function_name_ptr;
SAVE_OPLINE();
function_name_ptr = function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name));
}
+ fbc = Z_FUNC_P(func);
STR_FREE(lcname);
zval_dtor(free_op2.var);
-
- EX(call) = zend_vm_stack_push_call_frame(
- Z_FUNC_P(func), opline->extended_value, 0, NULL, NULL, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_TMP_VAR != IS_CONST && IS_TMP_VAR != IS_TMP_VAR &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
} else {
zval_dtor(free_op2.var);
}
-
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_TMP_VAR != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
-
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
zval_dtor(free_op2.var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Function name must be a string");
- ZEND_VM_NEXT_OPCODE(); /* Never reached */
+ ZEND_VM_CONTINUE(); /* Never reached */
}
+ EX(call) = zend_vm_stack_push_call_frame(
+ fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
}
{
USE_OPLINE
zend_function *fbc;
- zend_class_entry *called_scope;
- zend_object *object;
- zval *function_name_ptr, *function_name, *func;
+ zval *function_name, *func;
if (IS_VAR == IS_CONST) {
- function_name_ptr = function_name = (zval*)(opline->op2.zv+1);
+ function_name = (zval*)(opline->op2.zv+1);
if (CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv))) {
fbc = CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv));
} else if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(function_name))) == NULL)) {
} else {
zend_string *lcname;
zend_free_op free_op2;
+ zend_class_entry *called_scope;
+ zend_object *object;
+ zval *function_name_ptr;
SAVE_OPLINE();
function_name_ptr = function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name));
}
+ fbc = Z_FUNC_P(func);
STR_FREE(lcname);
zval_ptr_dtor_nogc(free_op2.var);
-
- EX(call) = zend_vm_stack_push_call_frame(
- Z_FUNC_P(func), opline->extended_value, 0, NULL, NULL, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_VAR != IS_CONST && IS_VAR != IS_TMP_VAR &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
} else {
zval_ptr_dtor_nogc(free_op2.var);
}
-
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_VAR != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
-
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
zval_ptr_dtor_nogc(free_op2.var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Function name must be a string");
- ZEND_VM_NEXT_OPCODE(); /* Never reached */
+ ZEND_VM_CONTINUE(); /* Never reached */
}
+ EX(call) = zend_vm_stack_push_call_frame(
+ fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
}
{
USE_OPLINE
zend_function *fbc;
- zend_class_entry *called_scope;
- zend_object *object;
- zval *function_name_ptr, *function_name, *func;
+ zval *function_name, *func;
if (IS_CV == IS_CONST) {
- function_name_ptr = function_name = (zval*)(opline->op2.zv+1);
+ function_name = (zval*)(opline->op2.zv+1);
if (CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv))) {
fbc = CACHED_PTR(Z_CACHE_SLOT_P(opline->op2.zv));
} else if (UNEXPECTED((func = zend_hash_find(EG(function_table), Z_STR_P(function_name))) == NULL)) {
} else {
zend_string *lcname;
+ zend_class_entry *called_scope;
+ zend_object *object;
+ zval *function_name_ptr;
SAVE_OPLINE();
function_name_ptr = function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name));
}
+ fbc = Z_FUNC_P(func);
STR_FREE(lcname);
- EX(call) = zend_vm_stack_push_call_frame(
- Z_FUNC_P(func), opline->extended_value, 0, NULL, NULL, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_CV != IS_CONST && IS_CV != IS_TMP_VAR &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
} else {
}
-
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else if (IS_CV != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
}
}
- EX(call) = zend_vm_stack_push_call_frame(
- fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Function name must be a string");
- ZEND_VM_NEXT_OPCODE(); /* Never reached */
+ ZEND_VM_CONTINUE(); /* Never reached */
}
+ EX(call) = zend_vm_stack_push_call_frame(
+ fbc, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
}
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
}
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CONST == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CONST != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CONST == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
}
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_TMP_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
-
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_TMP_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_TMP_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
}
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
-
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
}
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CV != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CV == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CV != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CV == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
}
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CONST == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CONST != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CONST == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
}
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_TMP_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
-
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
-
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_TMP_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_TMP_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
}
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
-
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
}
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CV != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CV == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CV != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CV == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
fbc = ce->constructor;
}
- if (fbc->common.fn_flags & ZEND_ACC_STATIC) {
- object = NULL;
- } else {
- if (Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
- /* We are calling method of the other (incompatible) class,
- but passing $this. This is done for compatibility with php-4. */
- if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
- } else {
- /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
- zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ object = NULL;
+ if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (Z_OBJ(EG(This))) {
+ if (Z_OBJ_HT(EG(This))->get_class_entry &&
+ !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+ /* We are calling method of the other (incompatible) class,
+ but passing $this. This is done for compatibility with php-4. */
+ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ } else {
+ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
+ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", fbc->common.scope->name->val, fbc->common.function_name->val);
+ }
}
- }
- object = Z_OBJ(EG(This));
- if (object) {
+ object = Z_OBJ(EG(This));
GC_REFCOUNT(object)++;
}
}
}
object = _get_obj_zval_ptr_unused(TSRMLS_C);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CONST == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CONST != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CONST == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
}
object = _get_obj_zval_ptr_unused(TSRMLS_C);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_TMP_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
-
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_TMP_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_TMP_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
}
object = _get_obj_zval_ptr_unused(TSRMLS_C);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
-
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
}
object = _get_obj_zval_ptr_unused(TSRMLS_C);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
+
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (IS_CV != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ if (IS_CV != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CV == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CV == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
}
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CONST == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CONST != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CONST == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
}
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_TMP_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
-
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_TMP_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_TMP_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_TMP_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
}
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
-
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
-
- if (IS_VAR != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
-
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_VAR == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
- }
- } else {
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
+
+ if (IS_VAR != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
+ }
+
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_VAR == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_VAR == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
+ }
+ }
+
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
obj = NULL;
} else {
}
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- obj = Z_TYPE_P(object) == IS_OBJECT ? Z_OBJ_P(object) : NULL;
- if (EXPECTED(obj != NULL)) {
- called_scope = zend_get_class_entry(obj TSRMLS_CC);
+ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CV != IS_CONST ||
- (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
- zend_object *orig_obj = obj;
+ HANDLE_EXCEPTION();
+ }
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
+ }
- if (UNEXPECTED(obj->handlers->get_method == NULL)) {
- zend_error_noreturn(E_ERROR, "Object does not support method calls");
- }
+ obj = Z_OBJ_P(object);
+ called_scope = zend_get_class_entry(obj TSRMLS_CC);
- /* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
- if (UNEXPECTED(fbc == NULL)) {
- zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
- }
- if (IS_CV == IS_CONST &&
- EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
- EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
- EXPECTED(obj == orig_obj)) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
- }
+ if (IS_CV != IS_CONST ||
+ (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) {
+ zend_object *orig_obj = obj;
+
+ if (UNEXPECTED(obj->handlers->get_method == NULL)) {
+ zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
- } else {
- if (UNEXPECTED(EG(exception) != NULL)) {
- HANDLE_EXCEPTION();
+ /* First, locate the function. */
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (opline->op2.zv + 1) : NULL) TSRMLS_CC);
+ if (UNEXPECTED(fbc == NULL)) {
+ zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(obj), Z_STRVAL_P(function_name));
+ }
+ if (IS_CV == IS_CONST &&
+ EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
+ EXPECTED((fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
+ EXPECTED(obj == orig_obj)) {
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
}
if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {