1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix arginfo/zpp consistency check for call_user_func from strict_types scope

This was using the wrong strict_types information. In this case the
call is performed with strict_types=0.
This commit is contained in:
Nikita Popov
2021-08-16 12:11:39 +02:00
parent 6e20f0f3a2
commit 8755976315
2 changed files with 17 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
--TEST--
Arginfo / zpp consistency check for call_user_func() in strict context
--FILE--
<?php
declare(strict_types=1);
namespace Foo;
// strlen() will be called with strict_types=0, so this is legal.
var_dump(call_user_func('strlen', false));
?>
--EXPECT--
int(0)

View File

@@ -886,12 +886,12 @@ cleanup_args:
EG(jit_trace_num) = orig_jit_trace_num;
} else {
ZEND_ASSERT(func->type == ZEND_INTERNAL_FUNCTION);
#if ZEND_DEBUG
bool should_throw = zend_internal_call_should_throw(func, call);
#endif
ZVAL_NULL(fci->retval);
call->prev_execute_data = EG(current_execute_data);
EG(current_execute_data) = call;
#if ZEND_DEBUG
bool should_throw = zend_internal_call_should_throw(func, call);
#endif
if (EXPECTED(zend_execute_internal == NULL)) {
/* saves one function call if zend_execute_internal is not used */
func->internal_function.handler(call, fci->retval);