xref: /PHP-5.6/ext/mbstring/tests/overload02.phpt (revision 003be7fe)
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(ereg_replace($c, '!!', $converted_str), mb_internal_encoding(), 'Shift_JIS');
28	var_dump(strpos($replaced, '!!'));
29}
30?>
31--EXPECT--
32EUC-JP
33int(10)
34int(8)
35int(3)
36int(29)
37