diff options
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 715808632e..3159766bc5 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -648,7 +648,6 @@ static ZEND_COLD void zend_verify_type_error_common( { zend_bool is_interface = 0; *fname = ZSTR_VAL(zf->common.function_name); - if (zf->common.scope) { *fsep = "::"; *fclass = ZSTR_VAL(zf->common.scope->name); @@ -674,6 +673,10 @@ static ZEND_COLD void zend_verify_type_error_common( } } else { switch (ZEND_TYPE_CODE(arg_info->type)) { + case IS_OBJECT: + *need_msg = "be an "; + *need_kind = "object"; + break; case IS_CALLABLE: *need_msg = "be callable"; *need_kind = ""; @@ -1667,16 +1670,9 @@ fetch_from_array: zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { if (!Z_ISREF_P(retval)) { - if (Z_REFCOUNTED_P(retval) && - Z_REFCOUNT_P(retval) > 1) { - if (Z_TYPE_P(retval) != IS_OBJECT) { - Z_DELREF_P(retval); - ZVAL_DUP(result, retval); - retval = result; - } else { - ZVAL_COPY_VALUE(result, retval); - retval = result; - } + if (result != retval) { + ZVAL_COPY(result, retval); + retval = result; } if (Z_TYPE_P(retval) != IS_OBJECT) { zend_class_entry *ce = Z_OBJCE_P(container); |
