bug74164.phpt 576 B

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