xref: /PHP-7.1/Zend/tests/bug73163.phpt (revision 8831a12d)
1--TEST--
2Bug #73163 (PHP hangs if error handler throws while accessing undef const in default value)
3--FILE--
4<?php
5
6function doSomething(string $value = UNDEFINED) {
7}
8
9set_error_handler(function($errno, $errstr) {
10    throw new Exception($errstr);
11});
12
13doSomething();
14
15?>
16--EXPECTF--
17Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d
18Stack trace:
19#0 %s(%d): {closure}(%s)
20#1 %s(%d): doSomething()
21#2 {main}
22  thrown in %s on line %d
23