1--TEST--
2Test strncmp() function: usage variations - different lengths
3--FILE--
4<?php
5/* Test strncmp() with various lengths */
6
7echo "*** Test strncmp() function: with different lengths ***\n";
8/* definitions of required variables */
9$str1 = "Hello, World\n";
10$str2 = "Hello, world\n";
11
12/* loop through to compare the strings, for various length values */
13for($len = strlen($str1); $len >= 0; $len--) {
14  var_dump( strncmp($str1, $str2, $len) );
15}
16echo "*** Done ***\n";
17?>
18--EXPECTREGEX--
19\*\*\* Test strncmp\(\) function: with different lengths \*\*\*
20int\(-[1-9][0-9]*\)
21int\(-[1-9][0-9]*\)
22int\(-[1-9][0-9]*\)
23int\(-[1-9][0-9]*\)
24int\(-[1-9][0-9]*\)
25int\(-[1-9][0-9]*\)
26int\(0\)
27int\(0\)
28int\(0\)
29int\(0\)
30int\(0\)
31int\(0\)
32int\(0\)
33int\(0\)
34\*\*\* Done \*\*\*
35