php-src/Zend/tests/closure_invoke_ref_warning.phpt
Nikita Popov 01453a0af7 Fix SEND_USER with ref arg
Even though the input is not a reference (or not treated as such),
we still need to create a reference to satisfy the function
signature. Various code relies on reference arguments actually
being references. In this particular case, it would result in
a JIT crash.

The zend_call_function() implementation already handled this
correctly.
2021-09-17 12:17:33 +02:00

12 lines
292 B
PHP

--TEST--
Argument name for Closure::__invoke via call_user_func reference warning
--FILE--
<?php
$test = function(&$arg) {};
call_user_func([$test, '__invoke'], null);
?>
--EXPECTF--
Warning: Closure::__invoke(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d