xref: /PHP-8.1/Zend/tests/bug74164.phpt (revision 960318ed)
1--TEST--
2Bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg)
3--FILE--
4<?php
5
6namespace Foo;
7
8set_error_handler(function ($type, $msg) {
9    throw new \Exception($msg);
10});
11
12call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable');
13?>
14--EXPECTF--
15Fatal error: Uncaught Exception: Foo\{closure}(): Argument #1 ($ref) must be passed by reference, value given in %s:%d
16Stack trace:
17#0 [internal function]: Foo\{closure}(%s)
18#1 %sbug74164.php(%d): call_user_func(%s)
19#2 {main}
20  thrown in %sbug74164.php on line %d
21