mirror of
https://github.com/php/php-src.git
synced 2024-10-17 22:42:38 +00:00
29 lines
353 B
Plaintext
29 lines
353 B
Plaintext
|
--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
|