3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught ValueError: mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "WINDOWS-1255" in /in/9fRuj:3 Stack trace: #0 /in/9fRuj(3): mb_detect_encoding('\xEF\xBF\xBD\x0E\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF...', 'WINDOWS-1255,AS...') #1 {main} thrown in /in/9fRuj on line 3
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: mb_detect_encoding(): Illegal argument in /in/9fRuj on line 3 detect UTF-8 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.2.0 - 7.2.6
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.0.20, 7.1.0 - 7.1.20
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.4.45, 5.5.0 - 5.5.38, 5.6.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.1.6, 5.2.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.3.11, 4.4.0 - 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.

preferences:
240.95 ms | 401 KiB | 353 Q