3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = mb_convert_encoding('\\', 'UTF-8', 'SJIS-win'); var_dump(bin2hex($s)); // string(2) "5c" $s = iconv('Shift_JIS', 'utf-8', '\\'); var_dump(bin2hex($s)); // string(4) "c2a5" $s = iconv('windows-31j', 'utf-8', '\\'); var_dump(bin2hex($s)); // string(2) "5c" $s = iconv('cp932', 'utf-8', '\\'); var_dump(bin2hex($s)); // string(2) "5c" $s = mb_convert_encoding('~', 'UTF-8', 'SJIS-win'); var_dump(bin2hex($s)); // string(2) "5c" $s = iconv('Shift_JIS', 'utf-8', '~'); var_dump(bin2hex($s)); // string(4) "c2a5" $s = iconv('windows-31j', 'utf-8', '~'); var_dump(bin2hex($s)); // string(2) "5c" $s = iconv('cp932', 'utf-8', '~'); var_dump(bin2hex($s)); // string(2) "5c"
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.5.34, 5.6.28, 7.0.14 - 7.1.0
string(2) "5c" string(4) "c2a5" string(2) "5c" string(2) "5c" string(2) "7e" string(6) "e280be" string(2) "7e" string(2) "7e"
Output for 7.0.0 - 7.0.11
string(2) "5c" Fatal error: Uncaught Error: Call to undefined function iconv() in /in/JcCel:6 Stack trace: #0 {main} thrown in /in/JcCel on line 6
Process exited with code 255.
Output for 5.5.35 - 5.6.26
string(2) "5c" Fatal error: Call to undefined function iconv() in /in/JcCel on line 6
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/JcCel on line 32
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(2) "5c" Fatal error: Call to undefined function: iconv() in /in/JcCel on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
string(2) "5c" Fatal error: Call to undefined function: iconv() in /in/JcCel on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(2) "5c" Fatal error: Call to undefined function: iconv() in /in/JcCel on line 6