3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "\357\277\275\016\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275:\357\277\275\357\277\275\034\357\277\275\357\27"; $charset = mb_detect_encoding($str , "WINDOWS-1255,ASCII"); echo "detect $charset\n"; $str = mb_convert_encoding($str, "UTF-8", $charset); echo convert %str\n;
based on rKSCa
Output for 7.2.0
detect Warning: mb_convert_encoding(): Illegal character encoding specified in /in/9fRuj on line 5 Warning: Use of undefined constant convert - assumed 'convert' (this will throw an Error in a future version of PHP) in /in/9fRuj on line 6 Fatal error: Uncaught Error: Undefined constant 'str\n' in /in/9fRuj:6 Stack trace: #0 {main} thrown in /in/9fRuj on line 6
Process exited with code 255.
Output for 7.0.0 - 7.1.10
detect Warning: mb_convert_encoding(): Illegal character encoding specified in /in/9fRuj on line 5 Notice: Use of undefined constant convert - assumed 'convert' in /in/9fRuj on line 6 Fatal error: Uncaught Error: Undefined constant 'str\n' in /in/9fRuj:6 Stack trace: #0 {main} thrown in /in/9fRuj on line 6
Process exited with code 255.
Output for 5.4.0 - 5.6.28
detect Warning: mb_convert_encoding(): Illegal character encoding specified in /in/9fRuj on line 5 Notice: Use of undefined constant convert - assumed 'convert' in /in/9fRuj on line 6 Fatal error: Undefined constant 'str\n' in /in/9fRuj on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Warning: mb_detect_encoding(): Illegal argument in /in/9fRuj on line 3 detect UTF-8 Notice: Use of undefined constant convert - assumed 'convert' in /in/9fRuj on line 6 Fatal error: Undefined constant 'str\n' in /in/9fRuj on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9fRuj on line 6 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /in/9fRuj on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9fRuj on line 6 Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /in/9fRuj on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9fRuj on line 6 Parse error: parse error, expecting `','' or `';'' in /in/9fRuj on line 6
Process exited with code 255.