3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); $arg = $arg[]; eval($arg); //return; } else eval($arg); } $string = "echo 'Hello drop Kyle';"; $find = array("update","drop"); safeEval($string,$find);
Output for 5.3.0 - 5.4.15
Fatal error: Cannot use [] for reading in /in/erCl5 on line 10
Process exited with code 255.