3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php mb_internal_encoding('SJIS-win'); $patern = 'abc'; $string1 = 'abcdeあいうえお'; $string2 = 'abcde'; $string3 = 'あabcdeⅰⅱⅲ'; $regs1 = array(); $regs2 = array(); $regs3 = array(); $replace = 'あいうえおⅰ'; mb_regex_encoding('SJIS-win'); print(mb_regex_encoding()); print("\n"); mb_ereg($patern, $string1, $regs1); mb_ereg($patern, $string2, $regs2); mb_ereg($patern, $string3, $regs3); var_dump($regs1); var_dump($regs2); var_dump($regs3); var_dump(mb_eregi_replace($patern, $replace, $string1)); var_dump(mb_eregi_replace($patern, $replace, $string2)); var_dump(mb_eregi_replace($patern, $replace, $string3));
based on YJTH8
Output for 7.1.0 - 7.3.1
SJIS array(0) { } array(1) { [0]=> string(3) "abc" } array(0) { } NULL string(20) "あいうえおⅰde" string(17) "あabcdeⅰⅱⅲ"
Output for 5.6.38 - 7.0.28
SJIS array(1) { [0]=> string(3) "abc" } array(1) { [0]=> string(3) "abc" } array(0) { } string(35) "あいうえおⅰdeあいうえお" string(20) "あいうえおⅰde" string(17) "あabcdeⅰⅱⅲ"