Lines Matching refs:strncmp
2 Test strncmp() function : basic functionality
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 echo "*** Testing strncmp() function: basic functionality ***\n";
12 echo "-- Testing strncmp() with single quoted string --\n";
13 var_dump( strncmp('Hello', 'Hello', 5) ); //expected: int(0)
14 var_dump( strncmp('Hello', 'Hi', 5) ); //expected: value < 0
15 var_dump( strncmp('Hi', 'Hello', 5) ); //expected: value > 0
17 echo "-- Testing strncmp() with double quoted string --\n";
18 var_dump( strncmp("Hello", "Hello", 5) ); //expected: int(0)
19 var_dump( strncmp("Hello", "Hi", 5) ); //expected: value < 0
20 var_dump( strncmp("Hi", "Hello", 5) ); //expected: value > 0
22 echo "-- Testing strncmp() with here-doc string --\n";
26 var_dump( strncmp($str, "Hello", 5) ); //expected: int(0)
27 var_dump( strncmp($str, "Hi", 5) ); //expected: value < 0
28 var_dump( strncmp("Hi", $str, 5) ); //expected: value > 0
33 \*\*\* Testing strncmp\(\) function: basic functionality \*\*\*
34 -- Testing strncmp\(\) with single quoted string --
38 -- Testing strncmp\(\) with double quoted string --
42 -- Testing strncmp\(\) with here-doc string --