]> granicus.if.org Git - php/commitdiff
- MFH: Added test for bug #29944.
authorDerick Rethans <derick@php.net>
Thu, 2 Sep 2004 06:35:04 +0000 (06:35 +0000)
committerDerick Rethans <derick@php.net>
Thu, 2 Sep 2004 06:35:04 +0000 (06:35 +0000)
tests/lang/bug29944.phpt [new file with mode: 0755]

diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt
new file mode 100755 (executable)
index 0000000..7882936
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Bug #29944 (function defined in switch crashes PHP)
+--FILE--
+<?PHP
+$a = 1;
+$b = "1";
+switch ($a) {
+       case 1:
+               function foo($bar) {
+                       if (preg_match('/\d/', $bar)) return true;
+                       return false;
+               }
+               echo foo($b);
+}              
+?>
+
+===DONE===
+--EXPECT--
+1
+===DONE===