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()); while($row_user = mysql_fetch_array($searchresult)){ // check if user is friend or not $fon="SELECT * FROM friends WHERE (user_id = '$user_id') OR (friend_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 = $row_user['id']; $user_photo = $row_user['photo']; $fullname = $row_user['fname'].' '.$row_user['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)
8.3.60.0070.01116.88
8.3.50.0100.00817.39
8.3.40.0180.00018.84
8.3.30.0090.00618.85
8.3.20.0050.00318.90
8.3.10.0030.00618.79
8.3.00.0060.00319.25
8.2.180.0070.01116.88
8.2.170.0160.00022.96
8.2.160.0160.00018.88
8.2.150.0070.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00721.00
8.2.110.0100.00019.25
8.2.100.0040.00817.78
8.2.90.0000.00919.28
8.2.80.0030.00617.97
8.2.70.0050.00317.50
8.2.60.0080.00017.90
8.2.50.0040.00417.93
8.2.40.0040.00419.48
8.2.30.0060.00317.81
8.2.20.0060.00317.70
8.2.10.0050.00317.81
8.2.00.0040.00417.75
8.1.280.0000.01425.92
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0080.00321.35
8.1.230.0000.01417.83
8.1.220.0040.00417.76
8.1.210.0050.00318.77
8.1.200.0030.00617.23
8.1.190.0000.00817.35
8.1.180.0030.00618.10
8.1.170.0030.00517.62
8.1.160.0030.00319.02
8.1.150.0000.00818.68
8.1.140.0040.00417.30
8.1.130.0040.00419.17
8.1.120.0000.00817.39
8.1.110.0050.00317.40
8.1.100.0000.00717.45
8.1.90.0070.00017.34
8.1.80.0000.00717.50
8.1.70.0000.00717.37
8.1.60.0070.00017.45
8.1.50.0040.00417.63
8.1.40.0060.00317.63
8.1.30.0000.00817.69
8.1.20.0050.00317.73
8.1.10.0000.00717.56
8.1.00.0000.00917.54
8.0.300.0060.00318.77
8.0.290.0060.00317.00
8.0.280.0000.00718.53
8.0.270.0000.00717.31
8.0.260.0000.00716.90
8.0.250.0000.00816.95
8.0.240.0070.00017.02
8.0.230.0000.00817.08
8.0.220.0050.00216.89
8.0.210.0000.00816.97
8.0.200.0040.00417.03
8.0.190.0060.00317.02
8.0.180.0040.00417.09
8.0.170.0080.00017.05
8.0.160.0070.00017.06
8.0.150.0030.00716.92
8.0.140.0040.00416.93
8.0.130.0000.00713.41
8.0.120.0000.00916.92
8.0.110.0040.00416.91
8.0.100.0070.00016.96
8.0.90.0000.00716.96
8.0.80.0040.01116.98
8.0.70.0040.00417.07
8.0.60.0040.00416.98
8.0.50.0030.00516.96
8.0.30.0120.00916.95
8.0.20.0120.00817.03
8.0.10.0040.00417.13
8.0.00.0110.01016.70
7.4.330.0050.00013.00
7.4.320.0030.00316.57
7.4.300.0040.00416.70
7.4.290.0040.00416.46
7.4.280.0030.00716.58
7.4.270.0030.00316.66
7.4.260.0060.00013.32
7.4.250.0040.00416.61
7.4.240.0040.00416.66
7.4.230.0000.00816.48
7.4.220.0110.01116.64
7.4.210.0090.00916.51
7.4.200.0080.00016.51
7.4.190.0050.00316.83
7.4.160.0120.00916.53
7.4.150.0140.00716.59
7.4.140.0070.01017.86
7.4.130.0100.01616.55
7.4.120.0060.01516.56
7.4.110.0130.00616.68
7.4.100.0090.00916.55
7.4.90.0070.01516.47
7.4.80.0090.01319.39
7.4.70.0040.01416.78
7.4.60.0140.00316.54
7.4.50.0030.00616.54
7.4.40.0090.00616.65
7.4.30.0120.00416.55
7.4.00.0060.00815.25
7.3.330.0060.00013.14
7.3.320.0060.00013.27
7.3.310.0030.00316.22
7.3.300.0000.00816.30
7.3.290.0090.00716.35
7.3.280.0030.01416.45
7.3.270.0120.00416.38
7.3.260.0070.01116.31
7.3.240.0090.01216.33
7.3.230.0130.00916.37
7.3.210.0110.00516.70
7.3.200.0030.01516.43
7.3.190.0110.00616.51
7.3.180.0080.00816.43
7.3.170.0090.00916.23
7.3.160.0120.00316.33
7.3.120.0060.00914.63
7.2.330.0030.01616.52
7.2.320.0100.00716.28
7.2.310.0130.00916.36
7.2.300.0100.00616.38
7.2.290.0090.00916.59
7.2.60.0100.00317.03
7.2.00.0030.00919.29
7.1.200.0060.00615.55
7.1.100.0050.00517.70
7.1.70.0040.00417.07
7.1.60.0040.01919.25
7.1.50.0230.01334.86
7.1.00.0030.07722.40
7.0.200.0000.00816.57
7.0.140.0000.07722.06
7.0.120.0000.06022.04
7.0.60.0200.06019.88
7.0.50.0100.08017.90
7.0.40.0130.05320.38
7.0.30.0300.08320.02
7.0.20.0370.05320.28
7.0.10.0100.06020.17
7.0.00.0030.06019.99
5.6.280.0100.06721.15
5.6.210.0100.08320.71
5.6.200.0070.06718.15
5.6.190.0030.09320.67
5.6.180.0500.07320.49
5.6.170.0270.03020.71
5.6.160.0030.05320.54
5.6.150.0070.03718.15
5.6.140.0030.04318.11
5.6.130.0070.07718.19
5.6.120.0070.08721.10
5.6.110.0070.05321.00
5.6.100.0070.08021.00
5.6.90.0030.04021.11
5.6.80.0000.04020.51
5.5.350.0200.06320.29
5.5.340.0130.07318.00
5.5.330.0030.04020.21
5.5.320.0030.08320.18
5.5.310.0300.03720.26
5.5.300.0030.04017.97
5.5.290.0270.06717.97
5.5.280.0070.04020.89
5.5.270.0070.08320.77
5.5.260.0100.06720.98
5.5.250.0100.07720.62
5.5.240.0000.03320.35
5.4.450.0030.04719.25
5.4.440.0030.04319.44
5.4.430.0030.05019.40
5.4.420.0100.07019.44
5.4.410.0030.07719.40
5.4.400.0100.06719.18
5.4.390.0070.07719.14
5.4.380.0070.07319.18
5.4.370.0100.04719.12
5.4.360.0170.04019.09
5.4.350.0070.07318.96
5.4.340.0070.07718.79
5.4.320.0100.07318.80
5.4.310.0070.05719.08
5.4.300.0000.08018.80
5.4.290.0170.06719.17
5.4.280.0070.04319.08
5.4.270.0170.06019.17
5.4.260.0100.03319.07
5.4.250.0030.05019.17
5.4.240.0030.03719.15
5.4.230.0030.03718.78
5.4.220.0070.07019.00
5.4.210.0000.08019.05
5.4.200.0070.04019.15
5.4.190.0030.05019.16
5.4.180.0100.03719.17
5.4.170.0000.08319.13
5.4.160.0070.08018.77
5.4.150.0070.06718.98
5.4.140.0100.06716.34
5.4.130.0070.07016.20
5.4.120.0100.06016.46
5.4.110.0070.03716.30
5.4.100.0130.07016.43
5.4.90.0070.04316.34
5.4.80.0100.03016.29
5.4.70.0070.03316.27
5.4.60.0070.04316.35
5.4.50.0030.07716.37
5.4.40.0070.03716.15
5.4.30.0070.03316.27
5.4.20.0030.04016.24
5.4.10.0070.07016.21
5.4.00.0070.06315.88
5.3.290.0030.08314.60
5.3.280.0030.08314.54
5.3.270.0170.06714.58
5.3.260.0100.06014.65
5.3.250.0030.07714.54
5.3.240.0030.07714.56
5.3.230.0070.07314.53
5.3.220.0070.05714.61
5.3.210.0000.04314.50
5.3.200.0030.04014.39
5.3.190.0070.07014.52
5.3.180.0070.05314.51
5.3.170.0070.04314.47
5.3.160.0070.06014.53
5.3.150.0030.07714.55
5.3.140.0000.07014.46
5.3.130.0030.08014.44
5.3.120.0100.04314.48
5.3.110.0000.05014.49
5.3.100.0070.07313.97
5.3.90.0030.06313.99
5.3.80.0070.05314.01
5.3.70.0000.07313.95
5.3.60.0100.07313.98
5.3.50.0030.07313.78
5.3.40.0070.07313.98
5.3.30.0000.05713.85
5.3.20.0000.04013.63
5.3.10.0070.07013.75
5.3.00.0030.05313.57
5.2.170.0100.04711.09
5.2.160.0030.05711.06
5.2.150.0070.06011.09
5.2.140.0100.03311.13
5.2.130.0030.05711.09
5.2.120.0170.05311.20
5.2.110.0000.07011.27
5.2.100.0100.02710.97
5.2.90.0100.05711.08
5.2.80.0070.02711.09
5.2.70.0030.04311.00
5.2.60.0030.05311.00
5.2.50.0070.05011.11
5.2.40.0070.06011.01
5.2.30.0070.03710.84
5.2.20.0000.03710.81
5.2.10.0030.05010.86
5.2.00.0030.04310.73
5.1.60.0100.0239.98
5.1.50.0000.06010.05
5.1.40.0030.0479.89
5.1.30.0030.03010.38
5.1.20.0000.04010.41
5.1.10.0030.05310.07
5.1.00.0030.0279.98
5.0.50.0000.0408.61
5.0.40.0030.0208.43
5.0.30.0000.0608.22
5.0.20.0030.0238.20
5.0.10.0030.0438.14
5.0.00.0000.0408.20
4.4.90.0030.0177.69
4.4.80.0030.0377.69
4.4.70.0000.0377.69
4.4.60.0000.0237.69
4.4.50.0000.0377.69
4.4.40.0000.0277.69
4.4.30.0030.0407.69
4.4.20.0130.0277.69
4.4.10.0030.0377.69
4.4.00.0000.0277.69
4.3.110.0070.0307.69
4.3.100.0000.0207.69
4.3.90.0030.0407.69
4.3.80.0000.0337.69
4.3.70.0000.0177.69
4.3.60.0000.0177.69
4.3.50.0030.0307.69
4.3.40.0070.0507.69
4.3.30.0000.0307.69
4.3.20.0000.0207.69
4.3.10.0000.0377.69
4.3.00.0000.0407.69

preferences:
44.43 ms | 401 KiB | 5 Q