1--TEST--
2mb_substr_count()
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--INI--
6output_handler=
7--FILE--
8<?php
9	mb_internal_encoding("EUC-JP");
10	var_dump(@mb_substr_count("", ""));
11	var_dump(@mb_substr_count("��", ""));
12	var_dump(@mb_substr_count("", "��"));
13	var_dump(@mb_substr_count("", "��"));
14	var_dump(@mb_substr_count("", chr(0)));
15
16	$a = str_repeat("abcacba", 100);
17	var_dump(@mb_substr_count($a, "bca"));
18
19	$a = str_repeat("��������������", 100);
20	$b = "������";
21	var_dump(@mb_substr_count($a, $b));
22
23	$to_enc = "UTF-8";
24	var_dump(@mb_substr_count(mb_convert_encoding($a, $to_enc),
25	                          mb_convert_encoding($b, $to_enc), $to_enc));
26
27	$to_enc = "Shift_JIS";
28	var_dump(@mb_substr_count(mb_convert_encoding($a, $to_enc),
29	                          mb_convert_encoding($b, $to_enc), $to_enc));
30
31	$a = str_repeat("abcacbabca", 100);
32	var_dump(@mb_substr_count($a, "bca"));
33?>
34--EXPECT--
35bool(false)
36bool(false)
37int(0)
38int(0)
39int(0)
40int(100)
41int(100)
42int(100)
43int(100)
44int(200)
45