xref: /PHP-7.2/tests/lang/bug29944.phpt (revision 17ccbeec)
1--TEST--
2Bug #29944 (function defined in switch crashes PHP)
3--FILE--
4<?PHP
5$a = 1;
6$b = "1";
7switch ($a) {
8	case 1:
9		function foo($bar) {
10			if (preg_match('/\d/', $bar)) return true;
11			return false;
12		}
13		echo foo($b);
14}
15?>
16
17===DONE===
18--EXPECT--
191
20===DONE===
21