3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (get_magic_quotes_gpc()) { echo 'mq enabled<BR>'; echo $_GET['lastname'],'<BR>'; // O\'reilly //echo addslashes($_GET['lastname']),'<BR>'; // O\\\'reilly -- why??? $lastname = stripslashes($_GET['lastname']); } else { echo 'no mq ...','<br>'; echo $_GET['lastname'],'<BR>'; $lastname = $_GET['lastname']; } // If using MySQL $lastname = mysql_real_escape_string($lastname); echo $lastname; // O\'reilly
Output for 7.0.0 - 7.3.0rc4
no mq ...<br> Notice: Undefined index: lastname in /in/co3uM on line 11 <BR> Notice: Undefined index: lastname in /in/co3uM on line 12 Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /in/co3uM:16 Stack trace: #0 {main} thrown in /in/co3uM on line 16
Process exited with code 255.
Output for 5.4.0 - 5.6.28
no mq ...<br> Notice: Undefined index: lastname in /in/co3uM on line 11 <BR> Notice: Undefined index: lastname in /in/co3uM on line 12 Fatal error: Call to undefined function mysql_real_escape_string() in /in/co3uM on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.29
mq enabled<BR> Notice: Undefined index: lastname in /in/co3uM on line 5 <BR> Notice: Undefined index: lastname in /in/co3uM on line 7 Fatal error: Call to undefined function mysql_real_escape_string() in /in/co3uM on line 16
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.2.17
mq enabled<BR> Notice: Undefined index: lastname in /in/co3uM on line 5 <BR> Notice: Undefined index: lastname in /in/co3uM on line 7 Fatal error: Call to undefined function mysql_real_escape_string() in /in/co3uM on line 16
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/co3uM on line 18
Process exited with code 255.
Output for 4.3.2 - 4.4.9
mq enabled<BR> Notice: Undefined index: lastname in /in/co3uM on line 5 <BR> Notice: Undefined index: lastname in /in/co3uM on line 7 Warning: mysql_real_escape_string(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/co3uM on line 16 Warning: mysql_real_escape_string(): A link to the server could not be established in /in/co3uM on line 16
Output for 4.3.0 - 4.3.1
mq enabled<BR> Notice: Undefined index: lastname in /in/co3uM on line 5 <BR> Notice: Undefined index: lastname in /in/co3uM on line 7 Warning: mysql_real_escape_string() [http://www.php.net/function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/co3uM on line 16 Warning: mysql_real_escape_string() [http://www.php.net/function.mysql-real-escape-string]: A link to the server could not be established in /in/co3uM on line 16