3v4l.org

run code in 300+ PHP versions simultaneously
<?php function conv($str): string { $res = ''; $res .= 'SJIS-win: ' . mb_convert_encoding($str, 'SJIS-win') . "\n"; return $res; } $res = ''; $res = conv('あ'); $res .= conv('~'); $res .= conv('\\'); $res .= conv('¥'); $res .= conv('‾'); echo $res;
Output for 7.0.0 - 7.0.6, 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
SJIS-win: �� SJIS-win: ~ SJIS-win: \ SJIS-win: �� SJIS-win: �P
Output for 5.6.9 - 5.6.40
Parse error: syntax error, unexpected ':', expecting '{' in /in/AaUu7 on line 2
Process exited with code 255.

preferences:
95.13 ms | 406 KiB | 5 Q