Skip to content

Commit 314eb09

Browse files
committed
Delay computation of scope
The scope is only needed for self/static/parent types. The static type cannot appear as a parameter type, and self/parent are more often than not resolved at compile time. Therefore we delay the resolution of the scope when it is require
1 parent a10a5b1 commit 314eb09

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Zend/zend_execute.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,7 @@ static zend_always_inline bool zend_verify_recv_arg_type(const zend_function *zf
12071207

12081208
if (ZEND_TYPE_IS_SET(cur_arg_info->type)
12091209
&& UNEXPECTED(!zend_check_type_and_coerce(&cur_arg_info->type, arg,
1210-
/* TODO: Pass scope to zend_verify_recv_arg_type()? */
1211-
zend_get_called_scope(EG(current_execute_data)),
1210+
NULL, /* Delay computation of scope, due to rarity of self types */
12121211
ZEND_ARG_USES_STRICT_TYPES(), 0))) {
12131212
zend_verify_arg_error(zf, cur_arg_info, arg_num, arg);
12141213
return false;
@@ -1222,8 +1221,7 @@ static zend_always_inline bool zend_verify_variadic_arg_type(
12221221
{
12231222
ZEND_ASSERT(ZEND_TYPE_IS_SET(arg_info->type));
12241223
if (UNEXPECTED(!zend_check_type_and_coerce(&arg_info->type, arg,
1225-
/* TODO: Pass scope to zend_verify_variadic_arg_type()? */
1226-
zend_get_called_scope(EG(current_execute_data)),
1224+
NULL, /* Delay computation of scope, due to rarity of self types */
12271225
ZEND_ARG_USES_STRICT_TYPES(),
12281226
0
12291227
))) {

0 commit comments

Comments
 (0)