3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$link = mysql_connect('localhost', 'root', '') or die('ERROR: ' . mysql_error()); //$sel = mysql_select_db(DB_NAME, $link) or die('ERROR: ' . mysql_error()); echo 'Hello World'; echo mysql_real_escape_string(trim($_SERVER['HTTP_USER_AGENT'])); echo 'Hello World'; ?>
Output for 7.0.0 - 7.1.0
Hello World Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /in/pCGmb:7 Stack trace: #0 {main} thrown in /in/pCGmb on line 7
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Hello World Fatal error: Call to undefined function mysql_real_escape_string() in /in/pCGmb on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Hello World Notice: Undefined index: HTTP_USER_AGENT in /in/pCGmb 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/pCGmb on line 7 Warning: mysql_real_escape_string(): A link to the server could not be established in /in/pCGmb on line 7 Hello World
Output for 4.3.0 - 4.3.1
Hello World Notice: Undefined index: HTTP_USER_AGENT in /in/pCGmb 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/pCGmb on line 7 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/pCGmb on line 7 Hello World