3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); //db include_once('db.php'); $user_email = $_SESSION['email']; $resultuid = mysql_query("SELECT `id` FROM `tbluser` WHERE `email` = '$user_email'") or die(mysql_error()); $row_id = mysql_fetch_assoc($resultuid); $user_id = $row_id['id']; // id of the user if(isSet($_POST['comment'])){ $gid=$_GET['gid']; $comment=$_POST['comment']; $msg_id=$_POST['msg_id']; $ip=$_SERVER['REMOTE_ADDR']; $comment=htmlentities($comment); $time=time(); $ip=$_SERVER['REMOTE_ADDR']; $query = mysql_query("SELECT id,comment FROM `group_comments` WHERE uid='$user_id' and msg_id='$msg_id' order by id desc limit 1 ") or die(mysql_error()); $result = mysql_fetch_array($query); if ($comment!=$result['comment']) { $query = mysql_query("INSERT INTO `group_comments` (comment, uid, msg_id, created) VALUES ('$comment', '$uid','$msg_id', '$time')") or die(mysql_error()); $newquery = mysql_query("SELECT id, uid, comment, msg_id, created FROM group_comments WHERE uid='$user_id' AND msg_id='$msg_id' order by id desc limit 1 "); $result = mysql_fetch_array($newquery); $com_id=result['id']; $comment=tolink(htmlentities($result['comment'] )); $time=$result['created']; $uid=$result['uid']; $uinf = mysql_query("SELECT * FROM `tbluser` WHERE `id` = '$uid'") or die(mysql_error()); $row_user = mysql_fetch_array($uinf); $fullname = $row_user['fname'].' '.$row_user['lname']; // full name of user $user_photo = $row_user['photo']; $user_photo="http://nitofa.com/user_pics/users/$user_photo"; header("Location: /groups/?id=".$gid."&msg=Comment posted!#stcommentbody".$com_id); ?> <div class="stcommentbody" id="stcommentbody<?php echo $com_id; ?>"> <div class="stcommentimg"> <img src="<?php echo $user_photo; ?>" class='small_face'/> </div> <div class="stcommenttext"> <!-- <a class="stcommentdelete" href="#" id='<?php echo $com_id; ?>'>X</a> --> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid;?>"><?php echo $fullname; ?></a></b> <?php echo $comment; ?> <div class="stcommenttime"><?php time_stamp($time); ?></div> </div> </div> <?php } } ?>

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)
7.4.00.0070.01315.20
7.3.120.0040.00714.92
7.3.110.0070.01114.93
7.3.100.0070.00714.74
7.3.90.0070.00714.82
7.3.80.0060.00614.88
7.3.70.0030.01014.77
7.3.60.0060.00614.73
7.3.50.0070.00814.79
7.3.40.0030.01014.80
7.3.30.0090.00614.55
7.3.20.0090.00916.77
7.3.10.0070.00716.69
7.3.00.0090.00316.70
7.2.250.0100.00714.95
7.2.240.0030.01815.00
7.2.230.0100.00315.04
7.2.220.0000.01115.30
7.2.210.0030.01215.10
7.2.200.0060.00615.10
7.2.190.0060.01015.18
7.2.180.0040.01115.05
7.2.170.0080.00615.11
7.2.60.0100.00316.75
7.2.00.0120.00619.22
7.1.330.0040.01115.68
7.1.320.0090.00615.82
7.1.310.0040.00715.90
7.1.300.0060.00315.77
7.1.290.0120.00015.47
7.1.280.0070.00415.73
7.1.270.0070.00715.81
7.1.260.0040.01115.82
7.1.200.0080.00415.81
7.1.100.0100.00318.12
7.1.70.0080.00317.30
7.1.60.0170.00719.40
7.1.50.0100.01316.98
7.1.00.0000.06722.36
7.0.200.0000.00816.74
7.0.140.0000.07722.02
7.0.110.0730.07319.88
7.0.100.0600.07319.96
7.0.90.0630.04719.89
7.0.80.0430.06719.84
7.0.70.0000.09019.91
7.0.60.0100.04319.94
7.0.50.0100.07020.51
7.0.40.0070.03720.05
7.0.30.0070.07320.00
7.0.20.0070.07320.12
7.0.10.0030.07720.05
7.0.00.0100.07319.96
5.6.280.0000.07320.83
5.6.260.0070.05020.64
5.6.250.0100.08020.65
5.6.240.0100.08320.65
5.6.230.0030.08320.65
5.6.220.0100.06720.46
5.6.210.0070.08320.52
5.6.200.0130.06321.01
5.6.190.0000.04321.12
5.6.180.0170.07021.16
5.6.170.0070.08021.00
5.6.160.0070.08321.00
5.6.150.0130.08021.07
5.6.140.0130.07720.97
5.6.130.0100.08021.30
5.6.120.0130.08021.16
5.6.110.0030.09021.15
5.6.100.0070.09021.22
5.6.90.0100.08321.28
5.6.80.0100.07720.36
5.6.70.0100.06020.48
5.6.60.0000.08320.32
5.6.50.0130.07720.48
5.6.40.0070.07320.35
5.6.30.0070.05020.46
5.6.20.0130.07720.58
5.6.10.0070.05320.51
5.6.00.0070.08320.32
5.5.380.0000.09020.20
5.5.370.0070.07020.52
5.5.360.0030.07020.19
5.5.350.0070.08020.42
5.5.340.0100.03320.71
5.5.330.0100.07020.76
5.5.320.0000.08720.88
5.5.310.0030.09321.05
5.5.300.0070.08720.84
5.5.290.0070.08320.89
5.5.280.0170.07721.02
5.5.270.0070.08320.98
5.5.260.0030.09320.84
5.5.250.0100.08020.83
5.5.240.0130.06020.34
5.5.230.0170.06720.20
5.5.220.0000.07720.37
5.5.210.0130.07020.09
5.5.200.0030.05020.11
5.5.190.0070.07020.33
5.5.180.0130.07720.26
5.5.160.0070.07320.15
5.5.150.0100.07020.27
5.5.140.0130.05320.35
5.5.130.0030.07720.30
5.5.120.0100.07720.31
5.5.110.0000.06320.24
5.5.100.0130.06020.16
5.5.90.0030.06020.01
5.5.80.0170.07020.16
5.5.70.0070.07720.14
5.5.60.0030.07320.02
5.5.50.0130.06020.13
5.5.40.0030.08320.27
5.5.30.0070.08020.24
5.5.20.0100.05319.99
5.5.10.0030.08719.94
5.5.00.0000.07719.97
5.4.450.0070.06319.42
5.4.440.0070.08319.27
5.4.430.0100.07719.50
5.4.420.0100.07319.37
5.4.410.0170.06319.16
5.4.400.0100.07319.22
5.4.390.0070.06719.18
5.4.380.0070.05019.25
5.4.370.0030.05019.34
5.4.360.0030.08018.95
5.4.350.0100.06719.02
5.4.340.0130.07319.14
5.4.320.0100.07019.18
5.4.310.0030.07719.23
5.4.300.0070.07319.16
5.4.290.0000.08019.18
5.4.280.0130.07018.94
5.4.270.0100.07319.34
5.4.260.0070.04319.09
5.4.250.0030.07318.98
5.4.240.0030.03719.17
5.4.230.0100.06318.99
5.4.220.0130.06719.00
5.4.210.0030.04718.97
5.4.200.0100.07719.23
5.4.190.0000.08019.22
5.4.180.0170.06319.32
5.4.170.0030.07719.18
5.4.160.0100.07018.96
5.4.150.0030.06019.12
5.4.140.0170.06316.51
5.4.130.0030.05716.33
5.4.120.0100.04016.33
5.4.110.0100.07016.27
5.4.100.0030.04716.59
5.4.90.0030.07316.55
5.4.80.0070.07016.64
5.4.70.0030.07716.56
5.4.60.0030.04716.34
5.4.50.0130.06316.53
5.4.40.0070.07316.45
5.4.30.0200.06316.24
5.4.20.0000.08016.33
5.4.10.0070.06316.38
5.4.00.0070.06315.95
5.3.290.0070.07714.59
5.3.280.0030.04314.54
5.3.270.0100.07714.70
5.3.260.0030.07714.49
5.3.250.0130.07014.57
5.3.240.0100.06714.52
5.3.230.0070.04014.63
5.3.220.0130.07314.60
5.3.210.0070.08014.48
5.3.200.0100.07014.43
5.3.190.0100.06714.37
5.3.180.0030.06314.52
5.3.170.0130.06714.64
5.3.160.0100.07314.51
5.3.150.0070.07314.66
5.3.140.0100.07314.67
5.3.130.0100.04014.49
5.3.120.0000.08714.49
5.3.110.0070.06714.50
5.3.100.0130.06713.95
5.3.90.0000.08713.83
5.3.80.0100.07313.82
5.3.70.0030.07714.13
5.3.60.0070.07013.94
5.3.50.0130.06713.89
5.3.40.0070.04313.97
5.3.30.0000.08013.82
5.3.20.0000.04713.61
5.3.10.0070.07313.61
5.3.00.0070.06713.73
5.2.170.0030.06313.43
5.2.160.0100.05713.43
5.2.150.0000.04013.43
5.2.140.0100.06013.43
5.2.130.0100.04713.43
5.2.120.0030.03713.43
5.2.110.0000.05013.43
5.2.100.0030.06013.43
5.2.90.0100.05313.43
5.2.80.0100.05013.43
5.2.70.0070.03313.43
5.2.60.0070.06313.43
5.2.50.0100.03713.43
5.2.40.0070.05713.43
5.2.30.0100.06013.43
5.2.20.0000.06313.43
5.2.10.0070.05713.43
5.2.00.0030.05713.43
5.1.60.0000.05713.43
5.1.50.0030.05313.43
5.1.40.0030.05313.43
5.1.30.0130.04313.43
5.1.20.0100.05013.43
5.1.10.0030.03013.43
5.1.00.0030.05313.43
5.0.50.0070.03713.43
5.0.40.0000.04713.43
5.0.30.0030.05313.43
5.0.20.0000.04713.43
5.0.10.0100.03713.43
5.0.00.0030.06313.43
4.4.90.0070.03013.43
4.4.80.0070.02713.43
4.4.70.0000.04013.43
4.4.60.0030.03313.43
4.4.50.0000.03713.43
4.4.40.0070.04313.43
4.4.30.0070.02713.43
4.4.20.0030.03313.43
4.4.10.0070.03013.43
4.4.00.0030.05013.43
4.3.110.0070.03313.43
4.3.100.0070.03013.43
4.3.90.0000.03313.43
4.3.80.0070.05013.43
4.3.70.0030.03313.43
4.3.60.0070.03013.43
4.3.50.0100.02313.43
4.3.40.0000.05013.43
4.3.30.0000.03013.43
4.3.20.0000.04013.43
4.3.10.0070.03013.43
4.3.00.0030.03313.43

preferences:
29.69 ms | 401 KiB | 5 Q