Annotation of embedaddon/php/ext/standard/tests/strings/substr_compare.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: substr_compare()
3: --FILE--
4: <?php
5:
6: var_dump(substr_compare("abcde", "bc", 1, 2));
7: var_dump(substr_compare("abcde", "bcg", 1, 2));
8: var_dump(substr_compare("abcde", "BC", 1, 2, true));
9: var_dump(substr_compare("abcde", "bc", 1, 3));
10: var_dump(substr_compare("abcde", "cd", 1, 2));
11: var_dump(substr_compare("abcde", "abc", 5, 1));
12: var_dump(substr_compare("abcde", "abcdef", -10, 10));
13:
14: var_dump(substr_compare("abcde", -1, 0, NULL, new stdClass));
15: echo "Test\n";
16: var_dump(substr_compare("abcde", "abc", -1, NULL, -5));
17: var_dump(substr_compare("abcde", -1, 0, "str", new stdClass));
18:
19: echo "Done\n";
20: ?>
21: --EXPECTF--
22: int(0)
23: int(0)
24: int(0)
25: int(1)
26: int(-1)
27:
28: Warning: substr_compare(): The start position cannot exceed initial string length in %s on line %d
29: bool(false)
30: int(0)
31:
32: Warning: substr_compare() expects parameter 5 to be boolean, object given in %s on line %d
33: bool(false)
34: Test
35:
36: Warning: substr_compare(): The length must be greater than zero in %s on line %d
37: bool(false)
38:
39: Warning: substr_compare() expects parameter 4 to be long, string given in %s on line %d
40: bool(false)
41: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>