This commit is contained in:
Antony Dovgal 2006-04-05 12:29:21 +00:00
parent 793d0ab719
commit c0592d17e9

View File

@ -0,0 +1,26 @@
--TEST--
fix #36944 (strncmp & strncasecmp do not return false on negative string length)
--FILE--
<?php
var_dump(strncmp("test ", "e", -1));
var_dump(strncmp("test ", "e", 10));
var_dump(strncmp("test ", "e", 0));
var_dump(strncasecmp("test ", "E", -1));
var_dump(strncasecmp("test ", "E", 10));
var_dump(strncasecmp("test ", "E", 0));
echo "Done\n";
?>
--EXPECTF--
Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
int(1)
int(0)
Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
int(15)
int(0)
Done