3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?PHP function escape($string) { if(is_array($string)) { foreach($string as $key => $val) { unset($string[$key]); $string[escape($key)] = escape($val); } } else { $string = @mysql_real_escape_string($string); } return $string;}function html($string) { if(is_array($string)) { foreach($string as $key => $val) { unset($string[$key]); $string[html($key)] = html($val); } } else { $string = htmlentities($string); } return $string;}$s= escape('asd"asiqwe\\');echo $s;echo html($s);?>
based on EqLV3
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /in/1bp5s:1 Stack trace: #0 /in/1bp5s(1): escape('asd"asiqwe\\') #1 {main} thrown in /in/1bp5s on line 1
Process exited with code 255.
Output for 5.0.0 - 5.6.28

Process exited with code 255.
Output for 4.3.0 - 4.4.9