1--TEST--
2Test strncasecmp() function: usage variations - double quoted strings
3--FILE--
4<?php
5/* Test strncasecmp() function with various double quoted strings for 'str1', 'str2' */
6
7echo "*** Test strncasecmp() 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( strncasecmp( $strings[$index1], $strings[$index2], (strlen($strings[$index1]) + 1) ) );
21  }
22  $count ++;
23}
24echo "*** Done ***\n";
25?>
26--EXPECTREGEX--
27\*\*\* Test strncasecmp\(\) function: with double quoted strings \*\*\*
28-- Iteration 1 --
29int\(0\)
30int\(0\)
31int\(0\)
32int\(-[1-9][0-9]*\)
33int\([1-9][0-9]*\)
34-- Iteration 2 --
35int\(0\)
36int\(0\)
37int\(0\)
38int\(-[1-9][0-9]*\)
39int\([1-9][0-9]*\)
40-- Iteration 3 --
41int\(0\)
42int\(0\)
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