1--TEST--
2Test strncmp() function: usage variations - different inputs(heredoc strings)
3--FILE--
4<?php
5/* Test strncmp() function with different strings for 'str1', 'str2' and considering case sensitive */
6
7echo "*** Test strncmp() function: with different input strings ***\n";
8
9/* heredoc string */
10$str1 = <<<EOD
11Example of string
12spanning multiple lines
13using heredoc syntax.
14EOD;
15
16/* identifier name contains underscore */
17$str2 = <<<identifier_str2
18Example of heredoc
19string, whose identifier
20having underscore("_")
21& numeric value.
22identifier_str2;
23
24/* identifier name starts with underscore */
25$str3 = <<<_identifier_str3
26Hello, World
27hello, world
28_identifier_str3;
29
30/* string containing control characters */
31$str4 = <<<identifier_str4
32Hello, World\n
33Hello\0World
34identifier_str4;
35
36$strings = array(
37  $str1,
38  $str2,
39  $str3,
40  $str4
41);
42/* loop through to compare each string with the other string */
43$count = 1;
44for($index1 = 0; $index1 < count($strings); $index1++) {
45  var_dump( strncmp( $strings[$index1], $strings[$index1], strlen($strings[$index1]) ) );
46  $count ++;
47}
48echo "*** Done ***\n";
49?>
50--EXPECT--
51*** Test strncmp() function: with different input strings ***
52int(0)
53int(0)
54int(0)
55int(0)
56*** Done ***
57