3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $exam=$_POST['exam']; $sub=$_POST['sub']; $col=$_POST['col']; $row=$_POST['row']; /*echo $exam; echo "<br>"; echo $sub; echo "<br>"; echo $col; echo "<br>";*/ echo "<p align='center'<b><font size='+2'>". $exam . "</font></b></p>"; echo "<p align='center'<b><font size='+1'>". $sub . "</font></b></p>"; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("marks", $con); $result = mysql_query("SELECT * FROM vi"); while($row = mysql_fetch_array($result)) { echo $row['1']; echo "<br />"; } mysql_close($con); echo"<div align='center'"; echo "<form name='sheet' action='csheet.php' onsubmit='return check()' method='post'>"; echo"<table width='200' border='1'>"; for($a=1;$a<=$row;$a++) { echo"<tr bgcolor='#0099FF'>"; for($b=1;$b<=$col;$b++) { echo"<td><input type='text' name='' size='8' /></td>"; } echo"</tr>"; } echo"</table>"; echo "<input type='submit' value='Submit'>"; echo "</form></div>"; ?>
based on oQgL3
Output for 7.0.0 - 7.2.0
Notice: Undefined index: exam in /in/cuG63 on line 3 Notice: Undefined index: sub in /in/cuG63 on line 4 Notice: Undefined index: col in /in/cuG63 on line 5 Notice: Undefined index: row in /in/cuG63 on line 6 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/cuG63:12 Stack trace: #0 {main} thrown in /in/cuG63 on line 12
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Notice: Undefined index: exam in /in/cuG63 on line 3 Notice: Undefined index: sub in /in/cuG63 on line 4 Notice: Undefined index: col in /in/cuG63 on line 5 Notice: Undefined index: row in /in/cuG63 on line 6 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Call to undefined function mysql_connect() in /in/cuG63 on line 12
Process exited with code 255.