1--TEST--
2Test stristr() function : basic functionality
3--FILE--
4<?php
5/* Prototype:  string stristr  ( string $haystack  , mixed $needle  [, bool $before_needle  ] )
6   Description: Case-insensitive strstr().
7*/
8
9echo "*** Testing stristr() : basic functionality ***\n";
10
11var_dump( stristr("Test string", "teSt") );
12var_dump( stristr("test stRIng", "striNG") );
13var_dump( stristr("teST StrinG", "stRIn") );
14var_dump( stristr("tesT string", "t S") );
15var_dump( stristr("test strinG", "g") );
16var_dump( bin2hex(stristr("te".chr(0)."St", chr(0))) );
17var_dump( stristr("tEst", "test") );
18var_dump( stristr("teSt", "test") );
19
20var_dump( stristr("Test String", "String", false) );
21var_dump( stristr("Test String", "String", true) );
22?>
23===DONE===
24--EXPECTF--
25*** Testing stristr() : basic functionality ***
26string(11) "Test string"
27string(6) "stRIng"
28string(6) "StrinG"
29string(8) "T string"
30string(1) "G"
31string(6) "005374"
32string(4) "tEst"
33string(4) "teSt"
34string(6) "String"
35string(5) "Test "
36===DONE===
37