3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //internal file if($msg_id) { $qlikes = mysql_query("SELECT * FROM group_likes WHERE msg_id = '$msg_id'") or die("Error while fetching likes"); $qrow = mysql_fetch_array($qlikes); $likes = mysql_num_rows($qlikes); $likes2 = $likes-1; $qliked = mysql_query("SELECT * FROM group_likes WHERE msg_id = '$msg_id' AND liker = '$user_id'") or die("error while getting user likes data"); $liked = mysql_num_rows($qliked); if($liked==1) { echo "<a class='like' href='unlike.php?id=".$msg_id."'>Unlike</a> &nbsp; "; if($likes > '1') { echo "You and ".$likes2." others likes this."; } else { echo "You like this."; } } else { echo "<a class='like' href='like.php?id=".$msg_id."'>Like</a> &nbsp; "; if($likes > 1 ) { echo $likes." others likes this."; } } } ?>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: msg_id in /in/3IoDS on line 5
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: msg_id in /in/3IoDS on line 5