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