summaryrefslogtreecommitdiff
path: root/tests/lang/bug26696.phpt
blob: e51978b3d2fa0195af6a9f5f432e2346bd444711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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