Annotation of embedaddon/php/ext/standard/tests/strings/stristr_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test 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:
9: echo "*** Testing stristr() : basic functionality ***\n";
10:
11: var_dump( stristr("Test string", "teSt") );
12: var_dump( stristr("test stRIng", "striNG") );
13: var_dump( stristr("teST StrinG", "stRIn") );
14: var_dump( stristr("tesT string", "t S") );
15: var_dump( stristr("test strinG", "g") );
16: var_dump( bin2hex(stristr(b"te".chr(0).b"St", chr(0))) );
17: var_dump( stristr("tEst", "test") );
18: var_dump( stristr("teSt", "test") );
19:
20: var_dump( stristr("Test String", "String", false) );
21: var_dump( stristr("Test String", "String", true) );
22: ?>
23: ===DONE===
24: --EXPECTF--
25: *** Testing stristr() : basic functionality ***
26: string(11) "Test string"
27: string(6) "stRIng"
28: string(6) "StrinG"
29: string(8) "T string"
30: string(1) "G"
31: string(6) "005374"
32: string(4) "tEst"
33: string(4) "teSt"
34: string(6) "String"
35: string(5) "Test "
36: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>