1--TEST--
2substr_compare()
3--FILE--
4<?php
5
6var_dump(substr_compare("abcde", "df", -2) < 0);
7var_dump(substr_compare("abcde", "bc", 1, 2));
8var_dump(substr_compare("abcde", "bcg", 1, 2));
9var_dump(substr_compare("abcde", "BC", 1, 2, true));
10var_dump(substr_compare("abcde", "bc", 1, 3) > 0);
11var_dump(substr_compare("abcde", "cd", 1, 2) < 0);
12var_dump(substr_compare("abcde", "abc", 5, 1));
13var_dump(substr_compare("abcde", "abcdef", -10, 10) < 0);
14var_dump(substr_compare("abcde", "abc", 0, 0));
15var_dump(substr_compare("abcde", -1, 0, NULL, new stdClass));
16echo "Test\n";
17var_dump(substr_compare("abcde", "abc", 0, -1));
18var_dump(substr_compare("abcde", "abc", -1, NULL, -5) > 0);
19var_dump(substr_compare("abcde", -1, 0, "str", new stdClass));
20
21echo "Done\n";
22?>
23--EXPECTF--
24bool(true)
25int(0)
26int(0)
27int(0)
28bool(true)
29bool(true)
30int(-1)
31bool(true)
32int(0)
33
34Warning: substr_compare() expects parameter 5 to be bool, object given in %s on line %d
35bool(false)
36Test
37
38Warning: substr_compare(): The length must be greater than or equal to zero in %s on line %d
39bool(false)
40bool(true)
41
42Warning: substr_compare() expects parameter 4 to be int, string given in %s on line %d
43bool(false)
44Done
45