xref: /PHP-7.2/ext/mbstring/tests/overload02.phpt (revision 17ccbeec)
1--TEST--
2Function overloading test 2
3--SKIPIF--
4<?php
5	extension_loaded('mbstring') or die('skip mbstring not available');
6	if (!function_exists("mail")) {
7		die('skip mail() function is not available.');
8	}
9	if (!function_exists("mb_ereg_replace")) {
10		die('skip mb_ereg_replace() function is not available.');
11	}
12?>
13--INI--
14output_handler=
15mbstring.func_overload=7
16mbstring.internal_encoding=EUC-JP
17--FILE--
18<?php
19echo mb_internal_encoding()."\n";
20
21$ngchars = array('ǽ','ɽ','��','��');
22$str = '��Ͻ�ܻ���Һ���ɽ��ǽ��ɽ��������˽��Ž�չ�ʸ����ͽ���Ƭ���ե���';
23$converted_str = mb_convert_encoding($str, 'Shift_JIS');
24mb_regex_encoding('Shift_JIS');
25foreach($ngchars as $c) {
26	$c = mb_convert_encoding($c, 'Shift_JIS');
27	$replaced = mb_convert_encoding(str_replace($c, '!!', $converted_str), mb_internal_encoding(), 'Shift_JIS');
28	var_dump(strpos($replaced, '!!'));
29}
30?>
31--EXPECT--
32Deprecated: The mbstring.func_overload directive is deprecated in Unknown on line 0
33EUC-JP
34int(10)
35int(8)
36int(3)
37int(29)
38