import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / stripos_variation13.php
bloba6412783c39b5a7418bd3fd9d565ed756297144b
1 <?php
2 /* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
3 * Description: Find position of first occurrence of a case-insensitive string
4 * Source code: ext/standard/string.c
5 */
7 /* Test stripos() function with null terminated strings for 'needle' argument
8 * in order to check binary safe
9 */
11 echo "*** Test stripos() function: binary safe ***\n";
12 $haystack = "\0Hello\0World\0";
14 $needles = array(
15 "Hello".chr(0)."World",
16 chr(0)."Hello World",
17 "Hello World".chr(0),
18 chr(0).chr(0).chr(0),
19 "Hello\0world",
20 "\0Hello",
21 "Hello\0"
24 for($index = 0; $index < count($needles); $index++ ) {
25 var_dump( stripos($haystack, $needles[$index]) );
26 var_dump( stripos($haystack, $needles[$index], $index) );
28 echo "*** Done ***";