3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.1.0
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 5.4.0 - 5.4.10, 7.0.0 - 7.0.14
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.6.28
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.2.14 - 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.