mirror of
https://github.com/php/php-src.git
synced 2024-12-15 21:05:51 +08:00
522a5e128f
currently it fails at least on Linux PPC and Solaris, probably because of different strncmp/strncasecmp implementations.
27 lines
567 B
PHP
27 lines
567 B
PHP
--TEST--
|
|
Bug #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(%d)
|
|
int(0)
|
|
|
|
Warning: Length must be greater than or equal to 0 in %s on line %d
|
|
bool(false)
|
|
int(%d)
|
|
int(0)
|
|
Done
|