3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); //Load latest update //error_reporting(0); // include db here include('db.php'); include_once 'includes/functions.php'; include_once 'includes/tolink.php'; include_once 'includes/time_stamp.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); $uid = $row_id['id']; // id of the user $Wall = new Wall_Updates(); if(isSet($_POST['update'])) { $update=$_POST['update']; $privacy=$_POST['privacy']; if($privacy=='0'){ $privacy=$privacy; } elseif( $privacy=='2' ) {$privacy=$privacy;} else { $privacy='1';} if(isSet($_FILES['photo'])) { $photo = $_FILES['photo']; $photoname = stripslashes($photo['name']); $photopath = "uploads/photos/".$uid."_" . basename($photoname); $ext = pathinfo($photo['tmp_name'], PATHINFO_EXTENSION); $ext = strtolower($ext); if (move_uploaded_file($photo['tmp_name'], $photopath)) { // Move succeed. list($width,$height)=getimagesize($photopath); if($width > 400 || $height > 300) { $photo = "<img src=\"".$photopath."\" width=\"400\" height=\"300\" />"; } else { $photo = "<img src=\"".$photopath."\" />"; } $data=$Wall->Insert_Photo($uid,$update,$photo,$privacy); } else { // Move failed. Possible duplicate? header("Location: wall.php?msg=Invalid image name!"); } } elseif(isSet($_FILES['file'])) { $file = $_FILES['file']; $filename = stripslashes($file['name']); $filepath = "uploads/docs/".$uid."_" . basename($filename); $ext = pathinfo($file['tmp_name'], PATHINFO_EXTENSION); $ext = strtolower($ext); if (move_uploaded_file($file['tmp_name'], $filepath)) { // Move succeed. $filepath="http://nitofa.com/$filepath"; $data=$Wall->Insert_Doc($uid,$update,$filepath,$privacy); } else { // Move failed. Possible duplicate? header("Location: wall.php?msg=Not valid file name!"); } } else { $data=$Wall->Insert_Update($uid,$update,$privacy); } if($data) { $msg_id=$data['msg_id']; $message=tolink(htmlentities($data['message'])); $time=$data['created']; $uid=$data['uid_fk']; $resultname = mysql_query("SELECT * FROM `tbluser` WHERE `id` = '$uid'") or die(mysql_error()); $row_name = mysql_fetch_assoc($resultname); $fullname = $row_name['fname'].' '.$row_name['lname']; // full name of user $face=$Wall->Avatar($uid); //$commentsarray=$Wall->Comments($msg_id); ?> <?php if(!$_GET['mode']=='ajax') { header("Location: wall.php?msg=Posted successfully!"); } ?> <div class="stimg"> <img src="<?php echo $face;?>" class='big_face'/> </div> <div class="sttext"> <a class="stdelete" href="#" id="<?php echo $msg_id;?>" title='Delete update'>X</a> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid;?>"><?php echo $fullname;?></a></b> <?php echo $message;?> <div class="sttime"><?php time_stamp($time);?> | <a href='#' class='commentopen' id='<?php echo $msg_id;?>' title='Comment'>Comment </a> | <?php include('likeunlike.php'); ?></div> <div id="stexpandbox"> <div id="stexpand"></div> </div> <div class="commentcontainer" id="commentload<?php echo $msg_id;?>"> <?php // include('load_comments.php') ?> </div> <div class="commentupdate" style='display:none' id='commentbox<?php echo $msg_id;?>'> <div class="stcommentimg"> <img src="<?php echo $face;?>" class='small_face'/> </div> <div class="stcommenttext" > <form method="post" action=""> <textarea name="comment" class="comment" maxlength="200" id="ctextarea<?php echo $msg_id;?>"></textarea> <br /> <input type="submit" value=" Comment " id="<?php echo $msg_id;?>" class="comment_button"/> </form> </div> </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)
8.3.70.0100.01316.63
8.3.60.0100.01017.00
8.3.50.0150.00917.41
8.3.40.0080.00818.92
8.3.30.0040.01118.80
8.3.20.0000.00818.85
8.3.10.0080.00019.03
8.3.00.0030.00919.51
8.2.180.0130.00316.63
8.2.170.0180.00322.96
8.2.160.0120.00419.08
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0090.00626.16
8.2.120.0040.00421.12
8.2.110.0100.00021.03
8.2.100.0120.00018.03
8.2.90.0030.00618.09
8.2.80.0130.00018.05
8.2.70.0080.00018.18
8.2.60.0040.00418.28
8.2.50.0030.00718.10
8.2.40.0080.00019.55
8.2.30.0050.00319.38
8.2.20.0090.00017.77
8.2.10.0040.00417.98
8.2.00.0040.00417.97
8.1.280.0170.00325.92
8.1.270.0000.00823.99
8.1.260.0060.00326.35
8.1.250.0120.00328.09
8.1.240.0100.00023.99
8.1.230.0000.01122.63
8.1.220.0030.00517.89
8.1.210.0080.00018.77
8.1.200.0080.00417.60
8.1.190.0060.00317.47
8.1.180.0030.00618.10
8.1.170.0050.00518.77
8.1.160.0030.00618.94
8.1.150.0000.00919.06
8.1.140.0080.00017.61
8.1.130.0000.00717.98
8.1.120.0040.00417.62
8.1.110.0040.00417.51
8.1.100.0000.00817.49
8.1.90.0040.00417.61
8.1.80.0040.00417.56
8.1.70.0040.00417.56
8.1.60.0080.00017.76
8.1.50.0030.00617.62
8.1.40.0090.00017.58
8.1.30.0030.00617.81
8.1.20.0000.00817.88
8.1.10.0000.00917.80
8.1.00.0080.00017.70
8.0.300.0060.00319.95
8.0.290.0000.00917.00
8.0.280.0070.00018.70
8.0.270.0000.00717.51
8.0.260.0030.00317.00
8.0.250.0040.00417.24
8.0.240.0060.00317.20
8.0.230.0040.00417.15
8.0.220.0040.00417.18
8.0.210.0070.00016.96
8.0.200.0000.00717.27
8.0.190.0080.00017.19
8.0.180.0040.00417.12
8.0.170.0050.00516.98
8.0.160.0000.00817.11
8.0.150.0060.00317.02
8.0.140.0080.00417.14
8.0.130.0000.00613.53
8.0.120.0080.00017.03
8.0.110.0040.00417.15
8.0.100.0000.00717.10
8.0.90.0000.00817.13
8.0.80.0100.01317.04
8.0.70.0000.00817.19
8.0.60.0080.00017.00
8.0.50.0080.00017.03
8.0.30.0200.00017.23
8.0.20.0080.01117.19
8.0.10.0050.00217.09
8.0.00.0090.01116.88
7.4.330.0050.00013.10
7.4.320.0070.00016.71
7.4.300.0030.00316.73
7.4.290.0000.00716.70
7.4.280.0030.00516.79
7.4.270.0050.00216.63
7.4.260.0030.00313.31
7.4.250.0000.00816.55
7.4.240.0030.00316.73
7.4.230.0000.00716.52
7.4.220.0090.00916.71
7.4.210.0100.01016.70
7.4.200.0040.00416.73
7.4.190.0050.00316.86
7.4.160.0090.00916.63
7.4.150.0030.01516.60
7.4.140.0150.00916.65
7.4.130.0140.00716.64
7.4.120.0120.00916.53
7.4.110.0170.00316.92
7.4.100.0030.01516.75
7.4.90.0160.00416.76
7.4.80.0090.01616.72
7.4.70.0130.00616.55
7.4.60.0090.01016.60
7.4.50.0000.00616.49
7.4.40.0190.00016.67
7.4.30.0090.00916.84
7.4.00.0060.00615.13
7.3.330.0070.00013.37
7.3.320.0030.00313.39
7.3.310.0000.00716.33
7.3.300.0070.00016.52
7.3.290.0080.00816.47
7.3.280.0140.00516.54
7.3.270.0090.00916.64
7.3.260.0120.00616.62
7.3.250.0090.01116.64
7.3.240.0120.00616.54
7.3.230.0070.01016.64
7.3.210.0100.01016.54
7.3.200.0110.00819.39
7.3.190.0070.01016.54
7.3.180.0060.01016.68
7.3.170.0190.00316.36
7.3.160.0050.01116.56
7.3.120.0030.01015.20
7.2.330.0140.00516.82
7.2.320.0040.01416.61
7.2.310.0190.00416.87
7.2.300.0140.00316.40
7.2.290.0090.00916.50
7.2.60.0040.01116.74
7.2.00.0040.00819.52
7.1.200.0100.00315.63
7.1.70.0000.01017.30
7.1.60.0080.00317.29
7.1.50.0110.01116.93
7.1.00.0030.03322.32
7.0.200.0030.00916.51
7.0.140.0030.07022.09
7.0.120.0130.06022.09
7.0.60.0170.07020.02
7.0.50.0000.04717.89
7.0.40.0030.09020.20
7.0.30.0230.05020.02
7.0.20.0270.08320.07
7.0.10.0000.07720.04
7.0.00.0070.08320.34
5.6.280.0000.07320.89
5.6.210.0130.07720.55
5.6.200.0030.07018.22
5.6.190.0130.06320.54
5.6.180.0270.05020.40
5.6.170.0330.07320.50
5.6.160.0100.08720.52
5.6.150.0130.07318.26
5.6.140.0000.05018.22
5.6.130.0000.04318.17
5.6.120.0030.04321.02
5.6.110.0130.08321.03
5.6.100.0100.08021.01
5.6.90.0130.07721.14
5.6.80.0030.05720.38
5.5.350.0170.06020.34
5.5.340.0130.05717.96
5.5.330.0100.07320.48
5.5.320.0370.07720.25
5.5.310.0430.06020.22
5.5.300.0170.07018.01
5.5.290.0130.07717.98
5.5.280.0030.05320.82
5.5.270.0000.04720.78
5.5.260.0030.04320.66
5.5.250.0070.06020.57
5.5.240.0100.03720.39
5.4.450.0070.07719.34
5.4.440.0100.07019.51
5.4.430.0070.07019.40
5.4.420.0070.06719.13
5.4.410.0070.07019.18
5.4.400.0130.06718.93
5.4.390.0100.07318.93
5.4.380.0070.08019.09
5.4.370.0130.07319.01
5.4.360.0070.07018.93
5.4.350.0070.03719.16
5.4.340.0030.04719.18
5.4.320.0030.05319.13
5.4.310.0000.07319.19
5.4.300.0070.05318.93
5.4.290.0030.05318.81
5.4.280.0000.05018.80
5.4.270.0000.04318.93
5.4.260.0030.08319.08
5.4.250.0070.07719.12
5.4.240.0030.06319.16
5.4.230.0170.07018.92
5.4.220.0070.04019.15
5.4.210.0070.04719.12
5.4.200.0030.04719.08
5.4.190.0030.04719.18
5.4.180.0070.06319.00
5.4.170.0030.05019.18
5.4.160.0000.07719.06
5.4.150.0200.03319.16
5.4.140.0000.05316.33
5.4.130.0000.07016.22
5.4.120.0230.03316.37
5.4.110.0070.07316.19
5.4.100.0070.07316.29
5.4.90.0070.07316.25
5.4.80.0130.06716.28
5.4.70.0070.06716.34
5.4.60.0030.07316.32
5.4.50.0070.07316.40
5.4.40.0000.07316.39
5.4.30.0070.07316.32
5.4.20.0030.07016.59
5.4.10.0030.04316.25
5.4.00.0130.06715.78
5.3.290.0030.06014.52
5.3.280.0100.06014.56
5.3.270.0030.08714.52
5.3.260.0070.08314.73
5.3.250.0130.04314.58
5.3.240.0130.04714.61
5.3.230.0100.04014.65
5.3.220.0000.04014.50
5.3.210.0100.03314.52
5.3.200.0070.07014.49
5.3.190.0030.05314.57
5.3.180.0100.04714.54
5.3.170.0070.03314.52
5.3.160.0030.05314.45
5.3.150.0070.04314.50
5.3.140.0000.08014.54
5.3.130.0130.04714.48
5.3.120.0170.06314.51
5.3.110.0070.07714.54
5.3.100.0070.07313.95
5.3.90.0030.07714.01
5.3.80.0070.06313.90
5.3.70.0100.05313.93
5.3.60.0130.05313.96
5.3.50.0000.05314.07
5.3.40.0100.07313.94
5.3.30.0130.06313.87
5.3.20.0000.04013.61
5.3.10.0170.03713.78
5.3.00.0070.04713.61
5.2.170.0070.03011.13
5.2.160.0070.03711.16
5.2.150.0070.06311.13
5.2.140.0000.03311.11
5.2.130.0100.05710.97
5.2.120.0070.06311.09
5.2.110.0000.03311.09
5.2.100.0000.03710.96
5.2.90.0030.06311.15
5.2.80.0100.06311.29
5.2.70.0000.05711.14
5.2.60.0100.05710.98
5.2.50.0030.03711.04
5.2.40.0030.06310.93
5.2.30.0030.03710.91
5.2.20.0030.03010.98
5.2.10.0070.04710.80
5.2.00.0070.06010.84
5.1.60.0100.04010.11
5.1.50.0030.05310.04
5.1.40.0070.02310.04
5.1.30.0000.03010.55
5.1.20.0030.02710.36
5.1.10.0030.04010.09
5.1.00.0030.05010.13
5.0.50.0070.0238.61
5.0.40.0030.0308.39
5.0.30.0000.0638.26
5.0.20.0070.0408.29
5.0.10.0030.0438.25
5.0.00.0030.0638.19
4.4.90.0000.0208.10
4.4.80.0070.0308.10
4.4.70.0030.0238.10
4.4.60.0070.0308.10
4.4.50.0070.0338.10
4.4.40.0030.0238.10
4.4.30.0000.0238.10
4.4.20.0000.0208.10
4.4.10.0030.0378.10
4.4.00.0070.0478.10
4.3.110.0100.0308.10
4.3.100.0000.0408.10
4.3.90.0030.0408.10
4.3.80.0030.0408.10
4.3.70.0070.0278.10
4.3.60.0070.0338.10
4.3.50.0000.0238.10
4.3.40.0000.0378.10
4.3.30.0070.0278.10
4.3.20.0000.0438.10
4.3.10.0070.0338.10
4.3.00.0000.0378.10

preferences:
49.35 ms | 401 KiB | 5 Q