summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/mb_ereg.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mbstring/tests/mb_ereg.phpt')
-rw-r--r--ext/mbstring/tests/mb_ereg.phpt34
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/mbstring/tests/mb_ereg.phpt b/ext/mbstring/tests/mb_ereg.phpt
index ff507adc07..bc95a5fbaa 100644
--- a/ext/mbstring/tests/mb_ereg.phpt
+++ b/ext/mbstring/tests/mb_ereg.phpt
@@ -9,26 +9,26 @@ function_exists('mb_ereg') or die("skip mb_ereg() is not available in this build
output_handler=
--FILE--
<?php
- mb_regex_set_options( '' );
+ mb_regex_set_options( '' );
- $encs = array( 'EUC-JP', 'Shift_JIS', 'SJIS', 'UTF-8' );
+ $encs = array( 'EUC-JP', 'Shift_JIS', 'SJIS', 'UTF-8' );
- function test_ereg( $test_enc, $pat, $str, $in_enc = 'EUC-JP' ) {
- mb_regex_encoding( $test_enc );
- $pat = mb_convert_encoding( $pat, $test_enc, $in_enc );
- $str = mb_convert_encoding( $str, $test_enc, $in_enc );
- printf( "(%d)%s\n", mb_ereg( $pat, $str, $reg ), ( is_array( $reg )? bin2hex(mb_convert_encoding( implode( ' ', $reg ), $in_enc, $test_enc )) : '' ) );
- }
- function do_tests( $enc ) {
- test_ereg( $enc, 'abc ([a-z]+) ([a-z]+) ([a-z]+)$', "abc def ghi jkl" );
- $pat = '([a-z]+) ([ あ-か]+)([か-な]+) ([わ-ん]+)$';
- test_ereg( $enc, $pat, 'abc あおい かこな わゑん' );
- test_ereg( $enc, $pat, 'mzxfp うおか きか をゐ' );
- }
+ function test_ereg( $test_enc, $pat, $str, $in_enc = 'EUC-JP' ) {
+ mb_regex_encoding( $test_enc );
+ $pat = mb_convert_encoding( $pat, $test_enc, $in_enc );
+ $str = mb_convert_encoding( $str, $test_enc, $in_enc );
+ printf( "(%d)%s\n", mb_ereg( $pat, $str, $reg ), ( is_array( $reg )? bin2hex(mb_convert_encoding( implode( ' ', $reg ), $in_enc, $test_enc )) : '' ) );
+ }
+ function do_tests( $enc ) {
+ test_ereg( $enc, 'abc ([a-z]+) ([a-z]+) ([a-z]+)$', "abc def ghi jkl" );
+ $pat = '([a-z]+) ([ あ-か]+)([か-な]+) ([わ-ん]+)$';
+ test_ereg( $enc, $pat, 'abc あおい かこな わゑん' );
+ test_ereg( $enc, $pat, 'mzxfp うおか きか をゐ' );
+ }
- foreach( $encs as $enc ) {
- do_tests( $enc );
- }
+ foreach( $encs as $enc ) {
+ do_tests( $enc );
+ }
?>
--EXPECT--
(15)6162632064656620676869206a6b6c2064656620676869206a6b6c