2 /* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
3 * Description: Binary safe case-insensitive string comparison of the first n characters
4 * Source code: Zend/zend_builtin_functions.c
7 /* Test strncasecmp() function with here-doc strings for 'str1', 'str2' */
9 echo "*** Test strncasecmp() function: with here-doc strings ***\n";
11 /* multi line heredoc string */
12 $multi_line_str = <<<EOD
14 spanning multiple lines
18 /* identifier name contains underscore */
19 $identifier_str1 = <<<identifier_str1
21 string, whose identifier
22 having
underscore("_")
26 /* identifier name starts with underscore */
27 $identifier_str2 = <<<_identifier_str2
32 /* string containing control character */
33 $control_char_str = <<<EOD
38 /* heredoc string with quote chars & slash */
39 $quote_char_string = <<<EOD
40 it's bright,but i cann't see it.
41 "things in double quote"
42 'things in single quote'
43 this\line is /with\slashs
46 /* heredoc string with blank line */
51 /* empty heredoc string */
52 $empty_string = <<<EOD
64 /* loop through to compare the strings */
65 $index2 = count($strings);
66 for($index1 = 0; $index1 < count($strings); $index1++) {
68 var_dump( strncasecmp( $strings[$index1], $strings[$index1], strlen($strings[$index1]) ) );
69 var_dump( strncasecmp( $strings[$index1], $strings[$index2], strlen($strings[$index1]) ) );
71 echo "*** Done ***\n";