3v4l.org

run code in 300+ PHP versions simultaneously
<?php // When converting halfwidth kana to JIS, mbfilter use JIS X 0201 kana. // string(22) "1b284931323334351b2842" var_dump(bin2hex(mb_convert_encoding(hex2bin('b1b2b3b4b5'), 'JIS', 'JIS'))); // < 8.0, mb_check_encoding compares before and after conversion to the same encoding. // bool(false) // >= 8.1, it is based only on successful conversion to wchar. // bool(true) var_dump(mb_check_encoding(hex2bin('b1b2b3b4b5'), 'JIS'));

preferences:
30.38 ms | 408 KiB | 5 Q