3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeEval($arg,$badwords=array()) { //if(stripos($arg,$badwords) !== false) $arg = explode("''",$arg); $bardwords = array($badwords); if(in_array($badwords,$arg)) { str_ireplace($badwords,"''",$arg); eval($arg); //return; } else eval($arg); } $string = "echo 'Hello drop Kyle'"; $find = array("update","drop"); safeEval($string';',$find);
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '';'' (T_CONSTANT_ENCAPSED_STRING) in /in/ocmBn on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.25
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /in/ocmBn on line 18
Process exited with code 255.

preferences:
196.68 ms | 1395 KiB | 49 Q