3v4l.org

run code in 300+ PHP versions simultaneously
<?php //this code shows friend suggestions. //******************************************************************************** // // User Id wgaira ka code dekh lena, is script me use krne k liye. OK. $user_id set honi chahye! // //******************************************************************************** // select all users in table: tbluser $searchq = "SELECT * FROM tbluser WHERE user_id <> '$user_id' LIMIT 5"; // it will show 4/5 suggestions. change to whatever you want $searchresult = mysql_query($searchq) or die(mysql_error()); $totalusers = mysql_num_rows($searchresult); while($users = mysql_fetch_array($searchresult)){ // check if user is friend or not $uid = $users['id']; $fon="SELECT * FROM my_friends WHERE (user_id = '$uid' AND friend_id='$user_id') OR (friend_id = '$uid' AND user_id='$user_id')"; $result = mysql_query($fon) or die(mysql_error()); $row = mysql_num_rows($result); // if user is not in friend list i.e $row=0 if ($row == 0) { $uid = $users['id']; $user_photo = $users['photo']; $fullname = $users['fname'].' '.$users['lname']; // you can change the link to add friend $add_friend_link = "<a style='font-size: small;' href='add_friend.php?fid=".$uid."'>Add as friend</a>"; //you can change this html to suit your needs $html = "<img src='".$user_photo."' align='absmiddle' alt='".$fullname."' title='".$fullname."'></img>".$fullname."<br/>".$add_friend_link." <br/><br/>'; //show the html code(friend suggestions) echo $html; //if user is in friend list, following code will show next friend suggestion } else { //continue; } } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.160.0070.07319.15
5.4.150.0100.05719.07
5.4.140.0030.05316.18
5.4.130.0070.07316.26
5.4.120.0000.07716.23
5.4.110.0130.04016.23
5.4.100.0130.06716.38
5.4.90.0030.04016.24
5.4.80.0130.06716.26
5.4.70.0000.07316.26
5.4.60.0100.06716.22
5.4.50.0070.07016.26
5.4.40.0130.05716.32
5.4.30.0030.07016.34
5.4.20.0100.04716.24
5.4.10.0100.07016.13
5.4.00.0100.07015.73
5.3.260.0070.06314.44
5.3.250.0100.07014.70
5.3.240.0070.04314.56
5.3.230.0030.04714.54
5.3.220.0070.05314.52
5.3.210.0030.08014.40
5.3.200.0000.07714.52
5.3.190.0000.05014.50
5.3.180.0070.06714.50
5.3.170.0070.06714.42
5.3.160.0000.06014.51
5.3.150.0030.04714.54
5.3.140.0070.07714.52
5.3.130.0070.08014.36
5.3.120.0170.06314.52
5.3.110.0130.06714.49
5.3.100.0130.05013.84
5.3.90.0030.07713.98
5.3.80.0030.07713.85
5.3.70.0070.07313.96
5.3.60.0170.06313.80
5.3.50.0070.05013.77
5.3.40.0130.06313.89
5.3.30.0030.05313.86
5.3.20.0000.04713.72
5.3.10.0030.05713.61
5.3.00.0070.07713.60

preferences:
139.42 ms | 1386 KiB | 7 Q