3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $con = mysql_connect("localhost","C00151376","F16b89a"); if (!$con){ die('Could not connect: ' . mysql_error()); } mysql_select_db("DB_C00151376_CA2", $con); $result = mysql_query("SELECT * FROM classes"); echo "<table border='1'> <tr> <th>Staff</th> <th>Lesson</th> <th>Classroom</th> <th>Date</th> <th>Edit</th> <th>Delete</th> </tr>"; while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>" . mysql_fetch_array(mysql_query("SELECT staff_name FROM staff WHERE ID=".$row['staff'].""))[0]. "</td>"; echo "<td>" . mysql_fetch_array(mysql_query("SELECT lesson_name FROM lesson WHERE ID=".$row['lesson'].""))[0]."</td>"; echo "<td>" . mysql_fetch_array(mysql_query("SELECT classroom_number FROM classroom WHERE ID=".$row['classroom'].""))[0]."</td>"; echo "<td>" . $row['date']. "</td>"; echo '<td> <a href="edit.php?id='.$row['ID'].'"> Edit </a> </td>'; echo '<td> <a href="delete.php?del='.$row['ID'].'"> Delete </a> </td>'; echo "</tr>"; } echo "</table>"; mysql_close($con); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/o92Hv:2 Stack trace: #0 {main} thrown in /in/o92Hv on line 2
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/o92Hv on line 2 Could not connect: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/o92Hv on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ',' or ';' in /in/o92Hv on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ',' or ';' in /in/o92Hv on line 24
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/o92Hv on line 24
Process exited with code 255.