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