3v4l.org

run code in 150+ 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.3.24, 5.4.0 - 5.4.15
Fatal error: Cannot use [] for reading in /in/1qKYK on line 9
Process exited with code 255.
Output for 5.3.25
Fatal error: Cannot use [] for reading in /in/CcYpS on line 9
Process exited with code 255.