mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
commit
ada2a55e07
2 changed files with 16 additions and 1 deletions
|
@ -807,8 +807,8 @@ cleanup_args:
|
||||||
zval *arg;
|
zval *arg;
|
||||||
uint32_t arg_num = ZEND_CALL_NUM_ARGS(call) + 1;
|
uint32_t arg_num = ZEND_CALL_NUM_ARGS(call) + 1;
|
||||||
zend_bool have_named_params = 0;
|
zend_bool have_named_params = 0;
|
||||||
zend_bool must_wrap = 0;
|
|
||||||
ZEND_HASH_FOREACH_STR_KEY_VAL(fci->named_params, name, arg) {
|
ZEND_HASH_FOREACH_STR_KEY_VAL(fci->named_params, name, arg) {
|
||||||
|
zend_bool must_wrap = 0;
|
||||||
zval *target;
|
zval *target;
|
||||||
if (name) {
|
if (name) {
|
||||||
void *cache_slot[2] = {NULL, NULL};
|
void *cache_slot[2] = {NULL, NULL};
|
||||||
|
|
15
ext/reflection/tests/bug80299.phpt
Normal file
15
ext/reflection/tests/bug80299.phpt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #80299: ReflectionFunction->invokeArgs confused in arguments
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$bar = new DateTime();
|
||||||
|
$args = [1, &$bar];
|
||||||
|
|
||||||
|
$function = function (int &$foo, DateTimeInterface &$bar) {};
|
||||||
|
|
||||||
|
(new ReflectionFunction($function))->invokeArgs($args);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Warning: {closure}(): Argument #1 ($foo) must be passed by reference, value given in %s on line %d
|
Loading…
Add table
Add a link
Reference in a new issue