mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
add test
This commit is contained in:
parent
793d0ab719
commit
c0592d17e9
26
ext/standard/tests/strings/bug36944.phpt
Normal file
26
ext/standard/tests/strings/bug36944.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user