xref: /PHP-7.4/Zend/tests/bug74164.phpt (revision 36fcc4cb)
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: Parameter 1 to Foo\{closure}() expected to be a reference, value given in %sbug74164.php:%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