3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? function get_menu() { $result = mysql_query("SELECT * FROM posts WHERE parent=0"); do { $res_array[$count] = $row; $count++; } while($row = mysql_fetch_array($result)); return $res_array; } function get_submenu($parent) { $result = mysql_query("SELECT * FROM posts WHERE parent=".$parent); do { error_reporting(0); $res_array[$count] = $row; $count++; } while($row = mysql_fetch_array($result)); return $res_array; } ?>
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Output for 4.3.0 - 5.3.29
<? function get_menu() { $result = mysql_query("SELECT * FROM posts WHERE parent=0"); do { $res_array[$count] = $row; $count++; } while($row = mysql_fetch_array($result)); return $res_array; } function get_submenu($parent) { $result = mysql_query("SELECT * FROM posts WHERE parent=".$parent); do { error_reporting(0); $res_array[$count] = $row; $count++; } while($row = mysql_fetch_array($result)); return $res_array; } ?>