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