3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = "some text "; var_dump(mb_convert_encoding($test, 'UTF-7', 'UTF-8')); var_dump(mb_convert_encoding($test, 'UCS-2', 'UTF-8')); var_dump(mb_detect_encoding($test, ['UTF-7', 'UTF-8', 'UCS-2']));

preferences:
46.07 ms | 402 KiB | 5 Q