strncasecmp_variation7.phpt [plain text]
--TEST--
Test strncasecmp() function : usage variations - binary safe
--FILE--
<?php
echo "*** Test strncasecmp() function: with null terminated strings and binary inputs ***\n";
$str1 = "Hello\0world";
$str2 = "Hello\0";
$str3 = "Hello,".chr(0)."world";
var_dump( strncasecmp($str1, $str2, 12) );
var_dump( strncasecmp($str3, "Hello,world", 12) );
echo "*** Done ***\n";
?>
--EXPECTF--
*** Test strncasecmp() function: with null terminated strings and binary inputs ***
int(5)
int(-119)
*** Done ***