xref: /PHP-8.1/tests/lang/bug29944.phpt (revision 7aacc705)
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--EXPECT--
171
18