Skip to content

Commit ada2a55

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: FIxed bug #80299
2 parents 3e2b127 + 904c1b6 commit ada2a55

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Zend/zend_execute_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,8 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
807807
zval *arg;
808808
uint32_t arg_num = ZEND_CALL_NUM_ARGS(call) + 1;
809809
zend_bool have_named_params = 0;
810-
zend_bool must_wrap = 0;
811810
ZEND_HASH_FOREACH_STR_KEY_VAL(fci->named_params, name, arg) {
811+
zend_bool must_wrap = 0;
812812
zval *target;
813813
if (name) {
814814
void *cache_slot[2] = {NULL, NULL};

ext/reflection/tests/bug80299.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
Bug #80299: ReflectionFunction->invokeArgs confused in arguments
3+
--FILE--
4+
<?php
5+
6+
$bar = new DateTime();
7+
$args = [1, &$bar];
8+
9+
$function = function (int &$foo, DateTimeInterface &$bar) {};
10+
11+
(new ReflectionFunction($function))->invokeArgs($args);
12+
13+
?>
14+
--EXPECTF--
15+
Warning: {closure}(): Argument #1 ($foo) must be passed by reference, value given in %s on line %d

0 commit comments

Comments
 (0)