summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/stristr_basic.phpt
blob: 73cbbbe17d516945530d72ecb5a429792b51f9c1 (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
29
30
31
32
33
34
35
36
--TEST--
Test stristr() function : basic functionality
--FILE--
<?php
/* Prototype:  string stristr  ( string $haystack  , mixed $needle  [, bool $before_needle  ] )
   Description: Case-insensitive strstr().
*/

echo "*** Testing stristr() : basic functionality ***\n";

var_dump( stristr("Test string", "teSt") );
var_dump( stristr("test stRIng", "striNG") );
var_dump( stristr("teST StrinG", "stRIn") );
var_dump( stristr("tesT string", "t S") );
var_dump( stristr("test strinG", "g") );
var_dump( bin2hex(stristr("te".chr(0)."St", chr(0))) );
var_dump( stristr("tEst", "test") );
var_dump( stristr("teSt", "test") );

var_dump( stristr("Test String", "String", false) );
var_dump( stristr("Test String", "String", true) );
?>
===DONE===
--EXPECT--
*** Testing stristr() : basic functionality ***
string(11) "Test string"
string(6) "stRIng"
string(6) "StrinG"
string(8) "T string"
string(1) "G"
string(6) "005374"
string(4) "tEst"
string(4) "teSt"
string(6) "String"
string(5) "Test "
===DONE===