1--TEST-- 2Test strncasecmp() function: usage variations - various lengths 3--FILE-- 4<?php 5/* Prototype : int strncasecmp ( string $str1, string $str2, int $len ); 6 * Description: Binary safe case-insensitive string comparison of the first n characters 7 * Source code: Zend/zend_builtin_functions.c 8*/ 9 10/* Test strncasecmp() with various lengths */ 11 12echo "*** Test strncasecmp() function: with different lengths ***\n"; 13/* definitions of required variables */ 14$str1 = "Hello, World\n"; 15$str2 = "Hello, world\n"; 16 17/* loop through to compare the strings, for various length values */ 18for($len = strlen($str1); $len >= 0; $len--) { 19 var_dump( strncasecmp($str1, $str2, $len) ); 20} 21echo "*** Done ***\n"; 22?> 23--EXPECT-- 24*** Test strncasecmp() function: with different lengths *** 25int(0) 26int(0) 27int(0) 28int(0) 29int(0) 30int(0) 31int(0) 32int(0) 33int(0) 34int(0) 35int(0) 36int(0) 37int(0) 38int(0) 39*** Done *** 40