3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function safeEval($arg,$badwords) { //if(stripos($arg,$badwords) !== false) $arg = explode("''",$arg); $bardwords = array(); if(in_array($badwords,$arg) { str_ireplace($badwords,"''",$arg) //echo "it has been found"; return; } else return eval($arg); } $string = "echo 'Hello drop Kyle';"; $find = array("update","drop"); safeEval($string,$find);
Output for 5.3.0 - 5.4.15
Parse error: syntax error, unexpected '{' in /in/A5kqG on line 8
Process exited with code 255.