3v4l.org

run code in 300+ PHP versions simultaneously
<?php function conv($str): string { $res = ''; $res .= ' SJIS: ' . mb_convert_encoding($str, 'SJIS', 'UTF-8') . "\n"; $res .= 'SJIS-win: ' . mb_convert_encoding($str, 'SJIS-win', 'UTF-8') . "\n"; return $res; } $res = ''; $res = conv('あ'); $res .= conv('~'); $res .= conv('\\'); echo $res;

preferences:
21.97 ms | 404 KiB | 5 Q