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));
11var_dump(substr_compare("abcde", "cd", 1, 2));
12var_dump(substr_compare("abcde", "abc", 5, 1));
13var_dump(substr_compare("abcde", "abcdef", -10, 10));
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));
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)
28int(1)
29int(-1)
30
31Warning: substr_compare(): The start position cannot exceed initial string length in %s on line %d
32bool(false)
33int(-1)
34int(0)
35
36Warning: substr_compare() expects parameter 5 to be boolean, object given in %s on line %d
37bool(false)
38Test
39
40Warning: substr_compare(): The length must be greater than or equal to zero in %s on line %d
41bool(false)
42int(0)
43
44Warning: substr_compare() expects parameter 4 to be long, string given in %s on line %d
45bool(false)
46Done
47