3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $db_host="localhost"; $db_user="root"; $db_pass=""; $db_name="test"; if(!$con=mysql_connect($db_host, $db_user, $db_pass)) { die("Connection Error. ". mysql_error()); } mysql_select_db($db_name, $con); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/PjhMJ:9 Stack trace: #0 {main} thrown in /in/PjhMJ on line 9
Process exited with code 255.
Output for hhvm-3.12.0
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/PjhMJ on line 9 Connection Error. Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/PjhMJ on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /in/PjhMJ on line 9 Connection Error. Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
Output for 4.3.1
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /in/PjhMJ on line 9 Connection Error. Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
Output for 4.3.0
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/PjhMJ on line 9 Connection Error. Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)