3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeEval($haystack,$needle,$return) { str_ireplace($needle,"' '",$haystack); $return = $haystack; return eval($haystack); //return; } $string = array("Hello","drop","Kyle").";"; $find = array("Drop"); safeEval($string,$find);
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
Warning: Array to string conversion in /in/oIpEU on line 10 Fatal error: Uncaught ArgumentCountError: Too few arguments to function safeEval(), 2 passed in /in/oIpEU on line 12 and exactly 3 expected in /in/oIpEU:2 Stack trace: #0 /in/oIpEU(12): safeEval('Array;', Array) #1 {main} thrown in /in/oIpEU on line 2
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Array to string conversion in /in/oIpEU on line 10 Fatal error: Uncaught ArgumentCountError: Too few arguments to function safeEval(), 2 passed in /in/oIpEU on line 12 and exactly 3 expected in /in/oIpEU:2 Stack trace: #0 /in/oIpEU(12): safeEval('Array;', Array) #1 {main} thrown in /in/oIpEU on line 2
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.26
Fatal error: Uncaught ArgumentCountError: Too few arguments to function safeEval(), 2 passed in /in/oIpEU on line 12 and exactly 3 expected in /in/oIpEU:2 Stack trace: #0 /in/oIpEU(12): safeEval('Array;', Array) #1 {main} thrown in /in/oIpEU on line 2
Process exited with code 255.
Output for 5.4.0 - 5.4.10, 7.0.0 - 7.0.33
Notice: Array to string conversion in /in/oIpEU on line 10 Warning: Missing argument 3 for safeEval(), called in /in/oIpEU on line 12 and defined in /in/oIpEU on line 2 Parse error: syntax error, unexpected ';', expecting '(' in /in/oIpEU(6) : eval()'d code on line 1
Process exited with code 255.
Output for 5.4.11 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Notice: Array to string conversion in /in/oIpEU on line 10 Warning: Missing argument 3 for safeEval(), called in /in/oIpEU on line 12 and defined in /in/oIpEU on line 2 Parse error: syntax error, unexpected ';', expecting '(' in /in/oIpEU(6) : eval()'d code on line 1
Output for 5.3.0 - 5.3.29
Warning: Missing argument 3 for safeEval(), called in /in/oIpEU on line 12 and defined in /in/oIpEU on line 2 Parse error: syntax error, unexpected ';', expecting '(' in /in/oIpEU(6) : eval()'d code on line 1
Process exited with code 255.

preferences:
252.57 ms | 401 KiB | 407 Q