1--TEST--
2Test substr_count() function (basic)
3--FILE--
4<?php
5
6echo "***Testing basic operations ***\n";
7var_dump(@substr_count("", ""));
8var_dump(@substr_count("a", ""));
9var_dump(@substr_count("", "a"));
10var_dump(@substr_count("", "a"));
11var_dump(@substr_count("", chr(0)));
12
13$a = str_repeat("abcacba", 100);
14var_dump(@substr_count($a, "bca"));
15
16$a = str_repeat("abcacbabca", 100);
17var_dump(@substr_count($a, "bca"));
18var_dump(substr_count($a, "bca", 200));
19var_dump(substr_count($a, "bca", 200, 50));
20var_dump(substr_count($a, "bca", -200));
21var_dump(substr_count($a, "bca", -200, 50));
22var_dump(substr_count($a, "bca", -200, -50));
23
24echo "Done\n";
25
26?>
27--EXPECT--
28***Testing basic operations ***
29bool(false)
30bool(false)
31int(0)
32int(0)
33int(0)
34int(100)
35int(200)
36int(160)
37int(10)
38int(40)
39int(10)
40int(30)
41Done
42