3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $username = ""; $password = ""; $hostname = "192.168.1.10/test"; $db = mysql_connect($hostname, $username, $password,"test") or die("Unable to connect to MySQL"); $result = $db->query("SELECT * FROM `users`"); while($row = $result->fetch_assoc()) { echo $row['id']; } ?>
based on 69ZB9
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/pdiMF:6 Stack trace: #0 {main} thrown in /in/pdiMF on line 6
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/pdiMF on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_connect(): Unknown MySQL Server Host '192.168.1.10/test' (11) in /in/pdiMF on line 6 Unable to connect to MySQL
Output for 4.3.0 - 4.3.1
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Unknown MySQL Server Host '192.168.1.10/test' (11) in /in/pdiMF on line 6 Unable to connect to MySQL