From: Nikita Popov Date: Fri, 25 Oct 2019 10:53:24 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d056fc6c0d06ce1f84c5bc0c310f04b43c5de14;p=php Merge branch 'PHP-7.4' * PHP-7.4: Fixed bug #78747 --- 7d056fc6c0d06ce1f84c5bc0c310f04b43c5de14 diff --cc ext/opcache/Optimizer/zend_func_info.c index 96fe6594f9,5c7a30a9f5..1aa590c389 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@@ -1222,11 -1631,10 +1222,11 @@@ uint32_t zend_get_func_info(const zend_ if (callee_func->type == ZEND_INTERNAL_FUNCTION) { zval *zv; - func_info_t *info; + zend_string *lcname = Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array, call_info->caller_init_opline, call_info->caller_init_opline->op2)); - zv = zend_hash_find_ex(&func_info, lcname, 1); - if (zv) { - if (!call_info->callee_func->common.scope && (zv = zend_hash_find_ex(&func_info, Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array, call_info->caller_init_opline, call_info->caller_init_opline->op2, ssa->rt_constants)), 1))) { - info = Z_PTR_P(zv); ++ if (!call_info->callee_func->common.scope ++ && (zv = zend_hash_find_ex(&func_info, lcname, 1))) { + func_info_t *info = Z_PTR_P(zv); if (UNEXPECTED(zend_optimizer_is_disabled_func(info->name, info->name_len))) { ret = MAY_BE_NULL; } else if (info->info_func) { diff --cc ext/zend_test/test.c index 8f2e104d1e,ad5f2fb446..cdff844ea9 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@@ -168,22 -159,20 +168,25 @@@ static zend_function *zend_test_class_m /* }}} */ static zend_function *zend_test_class_static_method_get(zend_class_entry *ce, zend_string *name) /* {{{ */ { - zend_internal_function *fptr; - - if (EXPECTED(EG(trampoline).common.function_name == NULL)) { - fptr = (zend_internal_function *) &EG(trampoline); - } else { - fptr = emalloc(sizeof(zend_internal_function)); + if (zend_string_equals_literal_ci(name, "test")) { - zend_internal_function *fptr = emalloc(sizeof(zend_internal_function)); - fptr->type = ZEND_OVERLOADED_FUNCTION; ++ zend_internal_function *fptr; ++ ++ if (EXPECTED(EG(trampoline).common.function_name == NULL)) { ++ fptr = (zend_internal_function *) &EG(trampoline); ++ } else { ++ fptr = emalloc(sizeof(zend_internal_function)); ++ } ++ memset(fptr, 0, sizeof(zend_internal_function)); ++ fptr->type = ZEND_INTERNAL_FUNCTION; + fptr->num_args = 1; - fptr->arg_info = NULL; + fptr->scope = ce; + fptr->fn_flags = ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_STATIC; - fptr->function_name = name; ++ fptr->function_name = zend_string_copy(name); + fptr->handler = ZEND_FN(zend_test_func); - zend_set_function_arg_flags((zend_function*)fptr); + + return (zend_function*)fptr; } - memset(fptr, 0, sizeof(zend_internal_function)); - fptr->type = ZEND_INTERNAL_FUNCTION; - fptr->num_args = 1; - fptr->scope = ce; - fptr->fn_flags = ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_STATIC; - fptr->function_name = zend_string_copy(name); - fptr->handler = ZEND_FN(zend_test_func); - - return (zend_function*)fptr; + return zend_std_get_static_method(ce, name, NULL); } /* }}} */ @@@ -198,7 -194,7 +207,8 @@@ static ZEND_METHOD(_ZendTestTrait, test /* }}} */ static const zend_function_entry zend_test_class_methods[] = { + ZEND_ME(_ZendTestClass, is_object, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(_ZendTestClass, __toString, NULL, ZEND_ACC_DEPRECATED) ZEND_FE_END };