3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function sql($data){ $data = urldecode($data); if (is_numeric($data)) { return $data; } else if (!get_magic_quotes_gpc()) { return mysql_real_escape_string($data); } else { return $data; } } print(sql('toto')) ?>
based on KpL7P
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /in/fZnD8:12 Stack trace: #0 /in/fZnD8(20): sql('toto') #1 {main} thrown in /in/fZnD8 on line 12
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Call to undefined function mysql_real_escape_string() in /in/fZnD8 on line 12
Process exited with code 255.
Output for 5.3.21 - 5.3.29
toto