3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? date_default_timezone_set('UTC'); $limit = 40; // 한 화면에 보여지는 재학생 행(레코드)수 if(!$now) { $now = 1; // 현재 페이지 번호 초기화 } $connect = mysql_connect("localhost", "root", "rhkddj12"); mysql_select_db("ust", $connect); if($Locus_name == null) { $sql = "select * from gmax_info order by Locus_name"; } else { $sql = "select * from gmax_info where Locus_name like '%$Locus_name%'"; } $result = mysql_query($sql, $connect); $total = mysql_num_rows($result); // 전체 재학생 행(레코드) 수 $total_page = (int)($total/$limit); if($total%$limit) { // 나머지가 있으면 $total_page++; // 전체 페이지 수 1 증가 } $start = ($now-1)*$limit; if($Locus_name == null) { $sql1 = "select * from gmax_info order by Locus_name limit $start, $limit"; } else { $sql1 = "select * from gmax_info where Locus_name like '%$Locus_name%' limit $start, $limit"; } $result1 = mysql_query($sql1, $connect); echo "<table border=1 bordercolor='#0033FF' align=center>"; echo "<tr><th>Locus_name<th>Transcript_name<th>Gene_name<th>Description"; while($row = mysql_fetch_array($result1)) { echo "<tr>"; echo "<td> $row[Locus_name] </td>"; echo "<td> $row[Transcript_name] </td>"; echo "<td> $row[Gene_name] </td>"; echo "<td> $row[Description] </td>"; echo "</tr>"; } echo "</table>"; for($i=1; $i<=$total_page; $i++) { if($i == $now) { echo("[$i]"); // 현재 페이지는 링크 안함 } else { echo (" <a href = hapmap_search_gene.php?now=$i&Locus_name=$Locus_name>[$i] </a>"); } } ?>
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: now in /in/CShe1 on line 4 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/CShe1:8 Stack trace: #0 {main} thrown in /in/CShe1 on line 8
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2
Notice: Undefined variable: now in /in/CShe1 on line 4 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/CShe1 on line 8 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /in/CShe1 on line 9 Notice: Undefined variable: Locus_name in /in/CShe1 on line 10 Warning: mysql_query() expects parameter 2 to be resource, boolean given in /in/CShe1 on line 15 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /in/CShe1 on line 16 Notice: Undefined variable: Locus_name in /in/CShe1 on line 24 Warning: mysql_query() expects parameter 2 to be resource, boolean given in /in/CShe1 on line 30 <table border=1 bordercolor='#0033FF' align=center><tr><th>Locus_name<th>Transcript_name<th>Gene_name<th>Description Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /in/CShe1 on line 35 </table>
Output for 5.4.0 - 5.6.28
Notice: Undefined variable: now in /in/CShe1 on line 4 Fatal error: Call to undefined function mysql_connect() in /in/CShe1 on line 8
Process exited with code 255.
Output for 4.3.1 - 5.3.29
<? date_default_timezone_set('UTC'); $limit = 40; // 한 화면에 보여지는 재학생 행(레코드)수 if(!$now) { $now = 1; // 현재 페이지 번호 초기화 } $connect = mysql_connect("localhost", "root", "rhkddj12"); mysql_select_db("ust", $connect); if($Locus_name == null) { $sql = "select * from gmax_info order by Locus_name"; } else { $sql = "select * from gmax_info where Locus_name like '%$Locus_name%'"; } $result = mysql_query($sql, $connect); $total = mysql_num_rows($result); // 전체 재학생 행(레코드) 수 $total_page = (int)($total/$limit); if($total%$limit) { // 나머지가 있으면 $total_page++; // 전체 페이지 수 1 증가 } $start = ($now-1)*$limit; if($Locus_name == null) { $sql1 = "select * from gmax_info order by Locus_name limit $start, $limit"; } else { $sql1 = "select * from gmax_info where Locus_name like '%$Locus_name%' limit $start, $limit"; } $result1 = mysql_query($sql1, $connect); echo "<table border=1 bordercolor='#0033FF' align=center>"; echo "<tr><th>Locus_name<th>Transcript_name<th>Gene_name<th>Description"; while($row = mysql_fetch_array($result1)) { echo "<tr>"; echo "<td> $row[Locus_name] </td>"; echo "<td> $row[Transcript_name] </td>"; echo "<td> $row[Gene_name] </td>"; echo "<td> $row[Description] </td>"; echo "</tr>"; } echo "</table>"; for($i=1; $i<=$total_page; $i++) { if($i == $now) { echo("[$i]"); // 현재 페이지는 링크 안함 } else { echo (" <a href = hapmap_search_gene.php?now=$i&Locus_name=$Locus_name>[$i] </a>"); } } ?>
Output for 4.3.0

Process exited with code 137.