Annotation of embedaddon/php/ext/standard/tests/strings/bug36944.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #36944 (strncmp & strncasecmp do not return false on negative string length)
3: --FILE--
4: <?php
5:
6: var_dump(strncmp("test ", "e", -1));
7: var_dump(strncmp("test ", "e", 10));
8: var_dump(strncmp("test ", "e", 0));
9:
10: var_dump(strncasecmp("test ", "E", -1));
11: var_dump(strncasecmp("test ", "E", 10));
12: var_dump(strncasecmp("test ", "E", 0));
13:
14: echo "Done\n";
15: ?>
16: --EXPECTF--
17: Warning: Length must be greater than or equal to 0 in %s on line %d
18: bool(false)
19: int(%d)
20: int(0)
21:
22: Warning: Length must be greater than or equal to 0 in %s on line %d
23: bool(false)
24: int(%d)
25: int(0)
26: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>