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.0030.01615.11
7.3.120.0070.01014.86
7.3.110.0020.01414.80
7.3.100.0080.00815.01
7.3.90.0070.00914.83
7.3.80.0080.00914.87
7.3.70.0060.00714.80
7.3.60.0020.01114.83
7.3.50.0070.00714.76
7.3.40.0070.01014.81
7.3.30.0130.00314.81
7.3.20.0100.00616.61
7.3.10.0070.00616.60
7.3.00.0090.00516.70
7.2.250.0100.01014.80
7.2.240.0090.00815.23
7.2.230.0080.00515.11
7.2.220.0090.00514.98
7.2.210.0050.01115.08
7.2.200.0100.00515.10
7.2.190.0030.01215.16
7.2.180.0060.01014.98
7.2.170.0060.00914.99
7.2.160.0070.00714.82
7.2.150.0140.00016.67
7.2.140.0090.00616.96
7.2.130.0080.00616.80
7.2.120.0040.01116.95
7.2.110.0020.01116.89
7.2.100.0080.00717.03
7.2.90.0020.01017.09
7.2.80.0070.00616.81
7.2.70.0040.01016.80
7.2.60.0080.00616.80
7.2.50.0070.00816.92
7.2.40.0050.00816.93
7.2.30.0080.00716.92
7.2.20.0080.00616.99
7.2.10.0080.00716.93
7.2.00.0010.01216.82
7.1.330.0090.00515.85
7.1.320.0090.00315.76
7.1.310.0020.01215.88
7.1.300.0050.00415.76
7.1.290.0100.00415.64
7.1.280.0050.01115.64
7.1.270.0070.00715.67
7.1.260.0090.00615.92
7.1.250.0070.00815.81
7.1.200.0080.00415.69
7.1.70.0070.01017.39
7.1.60.0000.02119.29
7.1.50.0070.01717.00
7.1.00.0000.08022.46
7.0.200.0030.00616.86
7.0.140.0030.07722.14
7.0.110.0070.05320.04
7.0.100.0130.08320.01
7.0.90.0030.09020.07
7.0.80.0100.07319.95
7.0.70.0100.07320.10
7.0.60.0170.05720.09
7.0.50.0170.07320.50
7.0.40.0100.07020.09
7.0.30.0070.05020.05
7.0.20.0070.08720.28
7.0.10.0170.06720.02
7.0.00.0070.08320.12
5.6.280.0100.06720.84
5.6.260.0070.08320.61
5.6.250.0170.06720.55
5.6.240.0130.06020.73
5.6.230.0070.07720.87
5.6.220.0100.06320.66
5.6.210.0130.07720.63
5.6.200.0030.06021.30
5.6.190.0070.08720.95
5.6.180.0100.06721.13
5.6.170.0200.06720.98
5.6.160.0130.08021.01
5.6.150.0000.08721.23
5.6.140.0130.07321.00
5.6.130.0070.08021.03
5.6.120.0070.07721.16
5.6.110.0030.08321.00
5.6.100.0170.06321.09
5.6.90.0030.08720.93
5.6.80.0230.03020.48
5.6.70.0070.07720.47
5.6.60.0100.03320.60
5.6.50.0000.04720.54
5.6.40.0000.07720.44
5.6.30.0000.07720.52
5.6.20.0070.04720.64
5.6.10.0130.06320.30
5.6.00.0100.07720.49
5.5.380.0100.07320.34
5.5.370.0230.06320.56
5.5.360.0100.07720.56
5.5.350.0100.07320.46
5.5.340.0070.08021.00
5.5.330.0100.08320.92
5.5.320.0030.08320.96
5.5.310.0100.08020.82
5.5.300.0170.06720.82
5.5.290.0070.05320.86
5.5.280.0130.07720.71
5.5.270.0230.07020.81
5.5.260.0200.07320.98
5.5.250.0100.07320.73
5.5.240.0030.06720.21
5.5.230.0170.06020.23
5.5.220.0130.07320.36
5.5.210.0030.08020.41
5.5.200.0170.06720.26
5.5.190.0000.08320.14
5.5.180.0070.07720.11
5.5.160.0030.08020.30
5.5.150.0170.06720.31
5.5.140.0000.08320.12
5.5.130.0130.06720.08
5.5.120.0070.04320.11
5.5.110.0000.04320.31
5.5.100.0030.04020.18
5.5.90.0030.04020.16
5.5.80.0100.05720.26
5.5.70.0070.04020.11
5.5.60.0000.04020.05
5.5.50.0100.03020.05
5.5.40.0030.04020.23
5.5.30.0070.04020.14
5.5.20.0070.03720.04
5.5.10.0100.03320.18
5.5.00.0100.06320.15
5.4.450.0100.07719.45
5.4.440.0000.08719.34
5.4.430.0070.07719.45
5.4.420.0030.07319.58
5.4.410.0100.07019.28
5.4.400.0100.06719.02
5.4.390.0130.06719.02
5.4.380.0030.08019.26
5.4.370.0130.04319.28
5.4.360.0070.06719.13
5.4.350.0100.07019.11
5.4.340.0070.08018.93
5.4.320.0070.04719.14
5.4.310.0100.07319.01
5.4.300.0100.06319.11
5.4.290.0070.08019.18
5.4.280.0030.04018.95
5.4.270.0000.04319.01
5.4.260.0030.06019.03
5.4.250.0030.03718.93
5.4.240.0030.04319.02
5.4.230.0070.06019.21
5.4.220.0030.06019.10
5.4.210.0000.04019.00
5.4.200.0070.04019.10
5.4.190.0130.05019.14
5.4.180.0000.04319.27
5.4.170.0070.06019.00
5.4.160.0030.03719.10
5.4.150.0070.03718.91
5.4.140.0030.05716.49
5.4.130.0070.03316.17
5.4.120.0100.03016.46
5.4.110.0030.03716.38
5.4.100.0070.06716.50
5.4.90.0030.03316.38
5.4.80.0030.03316.52
5.4.70.0030.03716.39
5.4.60.0070.03716.19
5.4.50.0000.03716.48
5.4.40.0030.03716.44
5.4.30.0070.03316.50
5.4.20.0030.04716.47
5.4.10.0000.04016.39
5.4.00.0000.03715.72
5.3.290.0070.08014.58
5.3.280.0000.04014.56
5.3.270.0000.04014.63
5.3.260.0070.05014.54
5.3.250.0000.05014.60
5.3.240.0070.04314.58
5.3.230.0030.07014.52
5.3.220.0030.03714.59
5.3.210.0070.03714.49
5.3.200.0070.07314.70
5.3.190.0100.07314.52
5.3.180.0000.04014.46
5.3.170.0000.04314.52
5.3.160.0000.04014.59
5.3.150.0030.04014.38
5.3.140.0030.03714.46
5.3.130.0100.05314.47
5.3.120.0070.06714.57
5.3.110.0000.04314.54
5.3.100.0030.03313.92
5.3.90.0000.04013.98
5.3.80.0030.03714.14
5.3.70.0030.03714.11
5.3.60.0030.04013.91
5.3.50.0000.06713.89
5.3.40.0000.04013.85
5.3.30.0070.03313.78
5.3.20.0000.04013.60
5.3.10.0030.03313.70
5.3.00.0030.03313.56
5.2.170.0030.02711.90
5.2.160.0070.02311.90
5.2.150.0030.03311.90
5.2.140.0000.03011.90
5.2.130.0030.02711.90
5.2.120.0000.03311.90
5.2.110.0000.03011.90
5.2.100.0030.02711.90
5.2.90.0000.03011.90
5.2.80.0000.03011.90
5.2.70.0000.03011.90
5.2.60.0070.05011.90
5.2.50.0030.05711.90
5.2.40.0100.05711.90
5.2.30.0030.03011.90
5.2.20.0000.06311.90
5.2.10.0030.05311.90
5.2.00.0130.05011.90
5.1.60.0030.03011.90
5.1.50.0070.04311.90
5.1.40.0070.04311.90
5.1.30.0030.05711.90
5.1.20.0100.05311.90
5.1.10.0100.03011.90
5.1.00.0030.05311.90
5.0.50.0000.04311.90
5.0.40.0070.04011.90
5.0.30.0030.06711.90
5.0.20.0070.04011.90
5.0.10.0070.04011.90
5.0.00.0100.05311.90
4.4.90.0000.01711.90
4.4.80.0030.01311.90
4.4.70.0000.04011.90
4.4.60.0030.01711.90
4.4.50.0030.03711.90
4.4.40.0030.05711.90
4.4.30.0030.03711.90
4.4.20.0070.02311.90
4.4.10.0000.03311.90
4.4.00.0030.04311.90
4.3.110.0070.03311.90
4.3.100.0000.03311.90
4.3.90.0000.03711.90
4.3.80.0070.05011.90
4.3.70.0030.03711.90
4.3.60.0000.03711.90
4.3.50.0000.04011.90
4.3.40.0070.05011.90
4.3.30.0000.04011.90
4.3.20.0030.03711.90
4.3.10.0000.04011.90
4.3.00.0070.03011.90

preferences:
36.13 ms | 401 KiB | 5 Q