1--TEST--
2Test strncmp() function: usage variations - single quoted strings
3--FILE--
4<?php
5/* Test strncmp() function with single quoted strings for 'str1', 'str2' */
6
7echo "*** Test strncmp() function: with single quoted strings ***\n";
8$strings = array(
9  'Hello, World',
10  'hello, world',
11  'HELLO, WORLD',
12  'Hello, World\n'
13);
14/* loop through to compare each string with the other string */
15$count = 1;
16for($index1 = 0; $index1 < count($strings); $index1++) {
17  echo "-- Iteration $count --\n";
18  for($index2 = 0; $index2 < count($strings); $index2++) {
19    var_dump( strncmp( $strings[$index1], $strings[$index2], (strlen($strings[$index1]) + 1) ) );
20  }
21  $count ++;
22}
23echo "*** Done ***\n";
24?>
25--EXPECTREGEX--
26\*\*\* Test strncmp\(\) function: with single quoted strings \*\*\*
27-- Iteration 1 --
28int\(0\)
29int\(-[1-9][0-9]*\)
30int\([1-9][0-9]*\)
31int\(-[1-9][0-9]*\)
32-- Iteration 2 --
33int\([1-9][0-9]*\)
34int\(0\)
35int\([1-9][0-9]*\)
36int\([1-9][0-9]*\)
37-- Iteration 3 --
38int\(-[1-9][0-9]*\)
39int\(-[1-9][0-9]*\)
40int\(0\)
41int\(-[1-9][0-9]*\)
42-- Iteration 4 --
43int\([1-9][0-9]*\)
44int\(-[1-9][0-9]*\)
45int\([1-9][0-9]*\)
46int\(0\)
47\*\*\* Done \*\*\*
48