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.30, 8.2.0 - 8.2.24, 8.3.0 - 8.3.12
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:
62.25 ms | 407 KiB | 5 Q