mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
test case for bug #26696
This commit is contained in:
parent
0d6fcd02cb
commit
a5ad026469
28
tests/lang/bug26696.phpt
Normal file
28
tests/lang/bug26696.phpt
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user