summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2004-01-20 00:25:30 +0000
committerfoobar <sniper@php.net>2004-01-20 00:25:30 +0000
commita5ad02646963e9276365b4f9f49a4adf8b33a356 (patch)
tree0d76273f03bd7caa4ff7bc654ca1ef81e8875d30
parent0d6fcd02cbc0bfdbcf36ea865a26aadd53c57850 (diff)
downloadphp-git-a5ad02646963e9276365b4f9f49a4adf8b33a356.tar.gz
test case for bug #26696
-rw-r--r--tests/lang/bug26696.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/lang/bug26696.phpt b/tests/lang/bug26696.phpt
new file mode 100644
index 0000000000..e51978b3d2
--- /dev/null
+++ b/tests/lang/bug26696.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #26696 (string index in a switch() crashes with multiple matches)
+--FILE--
+<?php
+
+$str = 'asdd/?';
+$len = strlen($str);
+for ($i = 0; $i < $len; $i++) {
+ switch ($str{$i}) {
+ case '?':
+ echo "OK\n";
+ break;
+ }
+}
+
+$str = '*';
+switch ($str{0}) {
+ case '*';
+ echo "OK\n";
+ break;
+ default:
+ echo 'Default RAN!';
+}
+
+?>
+--EXPECT--
+OK
+OK