1--TEST--
2Test strncmp() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing strncmp() function: basic functionality ***\n";
6
7echo "-- Testing strncmp() with single quoted string --\n";
8var_dump( strncmp('Hello', 'Hello', 5) );  //expected: int(0)
9var_dump( strncmp('Hello', 'Hi', 5) );  //expected: value < 0
10var_dump( strncmp('Hi', 'Hello', 5) );  //expected: value > 0
11
12echo "-- Testing strncmp() with double quoted string --\n";
13var_dump( strncmp("Hello", "Hello", 5) );  //expected: int(0)
14var_dump( strncmp("Hello", "Hi", 5) );  //expected: value < 0
15var_dump( strncmp("Hi", "Hello", 5) );  //expected: value > 0
16
17echo "-- Testing strncmp() with here-doc string --\n";
18$str = <<<HEREDOC
19Hello
20HEREDOC;
21var_dump( strncmp($str, "Hello", 5) );  //expected: int(0)
22var_dump( strncmp($str, "Hi", 5) );  //expected: value < 0
23var_dump( strncmp("Hi", $str, 5) );  //expected: value > 0
24
25echo "*** Done ***";
26?>
27--EXPECTREGEX--
28\*\*\* Testing strncmp\(\) function: basic functionality \*\*\*
29-- Testing strncmp\(\) with single quoted string --
30int\(0\)
31int\(-[1-9][0-9]*\)
32int\([1-9][0-9]*\)
33-- Testing strncmp\(\) with double quoted string --
34int\(0\)
35int\(-[1-9][0-9]*\)
36int\([1-9][0-9]*\)
37-- Testing strncmp\(\) with here-doc string --
38int\(0\)
39int\(-[1-9][0-9]*\)
40int\([1-9][0-9]*\)
41\*\*\* Done \*\*\*
42