3v4l.org

run code in 300+ PHP versions simultaneously
<?php function updateGoals() { $response = array(); if(!empty($_POST)){ if(isset($_POST["actID"]) && isset($_POST["nutID"]) && isset($_POST["activityProgress"]) && isset($_POST["nutritionProgress"])){ $actID = intval($_POST["actID"]); $nutID = intval($_POST["nutID"]); $actProg = floatval($_POST["activityProgress"]); $nutProg = floatval($_POST["nutritionProgress"]); } $query = "UPDATE Goals SET Progress='$nutProg' WHERE GoalID=$nutID;"; $result = mysql_query($query) or die(mysql_error()); if ($result) { $response["error"] = false; $response["message"] = "Nutrtition goal updated successfully!"; } else { $response["error"] = true; $response["message"] = "Failed to update nutrtition goal!"; } $query = "UPDATE Goals SET Progress='$actProg' WHERE GoalID=$actID;"; $result = mysql_query($query) or die(mysql_error()); if ($result) { $response["error"] = false; $response["message"] = "Activity goal updated successfully!"; } else { $response["error"] = true; $response["message"] = "Failed to update activity goal!"; } if (isset($_POST["newgoalID"]) && isset($_POST["newgoal"]) && $isset($_POST["newgoalProgress"])) { $newGoalID = intval($_POST["newgoalID"]); $newgoal = $_POST["newgoal"]; $newGoalProg = floatval($_POST["newgoalProgress"]); $query = "UPDATE Goals SET Description='$newgoal',Progress='$newGoalProg' WHERE GoalID=$newGoalID;"; $result = mysql_query($query) or die(mysql_error()); } else if(isset($_POST["newgoal"]) && isset($_POST["pid"]) && isset($_POST["week"])) { $newgoal = $_POST["newgoal"]; $pid = intval($_POST["pid"]); $week = intval($_POST["week"]); $query = "INSERT INTO Goals (ParticipantID, Type, Description, WeekNumbe r) VALUES ('$pid', 'OTHER', '$newgoal', '$week');"; $result = mysql_query($query) or die(mysql_error()); } } else { $response["error"] = true; $response["message"] = "Things are missing!"; } // echo json response echo json_encode($response); } updateGoals(); ?>

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.0180.00416.87
8.3.50.0100.01022.04
8.3.40.0130.01018.92
8.3.30.0110.00419.08
8.3.20.0060.00320.09
8.3.10.0080.00023.66
8.3.00.0060.00319.26
8.2.180.0070.01418.33
8.2.170.0090.00622.96
8.2.160.0070.00720.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00422.15
8.2.110.0090.00022.29
8.2.100.0030.00917.72
8.2.90.0030.00717.75
8.2.80.0060.00317.97
8.2.70.0060.00318.03
8.2.60.0040.00417.93
8.2.50.0000.00818.10
8.2.40.0050.00322.37
8.2.30.0050.00318.07
8.2.20.0040.00417.69
8.2.10.0040.00718.25
8.2.00.0080.00417.84
8.1.280.0070.00725.92
8.1.270.0060.00323.91
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0090.00022.59
8.1.230.0000.01119.29
8.1.220.0030.00517.78
8.1.210.0080.00018.77
8.1.200.0080.00317.47
8.1.190.0000.00817.48
8.1.180.0080.00018.10
8.1.170.0060.00318.67
8.1.160.0000.00722.12
8.1.150.0040.00418.64
8.1.140.0050.00217.47
8.1.130.0050.00317.92
8.1.120.0040.00417.50
8.1.110.0080.00017.52
8.1.100.0060.00317.55
8.1.90.0020.00517.43
8.1.80.0040.00417.45
8.1.70.0030.00317.51
8.1.60.0000.00917.72
8.1.50.0000.00817.53
8.1.40.0040.00417.61
8.1.30.0040.00417.59
8.1.20.0060.00317.64
8.1.10.0060.00317.70
8.1.00.0040.00417.45
8.0.300.0000.00819.86
8.0.290.0000.00816.88
8.0.280.0030.00518.56
8.0.270.0070.00017.33
8.0.260.0040.00417.32
8.0.250.0000.00717.02
8.0.240.0030.00317.05
8.0.230.0000.00716.93
8.0.220.0070.00016.84
8.0.210.0000.00716.92
8.0.200.0000.00717.00
8.0.190.0070.00017.08
8.0.180.0030.00516.91
8.0.170.0000.00917.02
8.0.160.0000.00816.93
8.0.150.0040.00417.02
8.0.140.0040.00416.95
8.0.130.0040.00313.37
8.0.120.0080.00016.96
8.0.110.0000.00816.90
8.0.100.0040.00416.95
8.0.90.0040.00417.07
8.0.80.0050.01016.89
8.0.70.0000.00816.86
8.0.60.0020.00516.97
8.0.50.0000.00716.84
8.0.30.0140.00517.24
8.0.20.0110.01317.40
8.0.10.0070.00017.00
8.0.00.0090.01016.83
7.4.330.0050.00015.00
7.4.320.0030.00316.66
7.4.300.0070.00016.56
7.4.290.0080.00016.54
7.4.280.0000.00716.55
7.4.270.0070.00016.49
7.4.260.0030.00316.67
7.4.250.0030.00516.63
7.4.240.0020.00516.64
7.4.230.0000.00716.74
7.4.220.0090.00816.60
7.4.210.0080.00916.71
7.4.200.0030.00316.76
7.4.190.0030.00316.73
7.4.160.0080.01116.69
7.4.150.0070.01017.40
7.4.140.0100.01417.86
7.4.130.0050.01116.62
7.4.120.0090.00816.71
7.4.110.0060.01216.64
7.4.100.0140.00516.60
7.4.90.0070.01116.42
7.4.80.0030.01319.39
7.4.70.0160.00716.62
7.4.60.0100.00616.47
7.4.50.0000.00716.55
7.4.40.0060.00622.77
7.4.30.0060.01016.65
7.4.10.0030.01214.95
7.4.00.0060.01015.02
7.3.330.0000.00613.34
7.3.320.0000.00513.37
7.3.310.0000.00716.35
7.3.300.0040.00416.38
7.3.290.0090.00616.38
7.3.280.0070.01216.37
7.3.270.0040.01517.40
7.3.260.0130.01016.68
7.3.250.0110.00616.51
7.3.240.0060.01116.34
7.3.230.0090.00916.73
7.3.210.0110.00616.26
7.3.200.0080.01219.39
7.3.190.0080.00816.45
7.3.180.0070.00716.39
7.3.170.0130.00316.49
7.3.160.0180.00016.78
7.3.130.0070.01314.95
7.3.120.0070.01014.86
7.3.110.0100.00814.84
7.3.100.0060.00614.83
7.3.90.0060.00414.80
7.3.80.0070.00815.00
7.3.70.0040.00714.93
7.3.60.0060.00714.60
7.3.50.0060.00714.64
7.3.40.0080.00614.90
7.3.30.0060.00314.80
7.3.20.0050.00716.75
7.3.10.0060.00916.70
7.3.00.0020.00816.55
7.2.330.0070.01416.63
7.2.320.0070.01116.37
7.2.310.0030.01316.56
7.2.300.0100.00716.62
7.2.290.0070.01116.53
7.2.260.0070.01015.09
7.2.250.0060.01315.14
7.2.240.0050.01215.10
7.2.230.0070.00715.16
7.2.220.0070.00715.01
7.2.210.0070.00414.88
7.2.200.0020.01214.96
7.2.190.0080.00715.07
7.2.180.0060.00514.93
7.2.170.0060.00814.88
7.2.160.0070.01015.10
7.2.150.0060.00316.86
7.2.140.0040.01116.91
7.2.130.0000.01616.98
7.2.120.0100.00716.91
7.2.110.0080.00816.75
7.2.100.0070.01017.03
7.2.90.0030.00916.96
7.2.80.0060.01016.87
7.2.70.0060.00916.76
7.2.60.0040.01216.86
7.2.50.0070.00716.83
7.2.40.0100.00317.03
7.2.30.0090.00316.99
7.2.20.0070.01017.00
7.2.10.0120.00616.50
7.2.00.0260.00618.10
7.1.330.0100.00615.69
7.1.320.0080.00515.74
7.1.310.0090.00515.76
7.1.300.0030.00915.80
7.1.290.0060.00715.63
7.1.280.0030.01015.69
7.1.270.0070.00615.62
7.1.260.0080.00515.70
7.1.250.0030.01015.69
7.1.240.0000.01515.73
7.1.230.0000.01315.92
7.1.220.0030.01015.58
7.1.210.0040.01115.79
7.1.200.0090.00615.57
7.1.190.0070.00315.72
7.1.180.0060.00915.75
7.1.170.0060.00315.87
7.1.160.0000.01215.74
7.1.150.0100.00315.46
7.1.140.0000.00915.65
7.1.130.0000.01315.80
7.1.120.0110.00415.74
7.1.110.0000.01315.67
7.1.100.0040.00617.13
7.1.90.0040.01115.85
7.1.80.0030.01215.88
7.1.70.0010.01316.42
7.1.60.0080.01217.60
7.1.50.0090.01025.14
7.1.40.0040.01115.78
7.1.30.0120.00015.84
7.1.20.0000.01415.89
7.1.10.0060.00915.47
7.1.00.0060.04019.09
7.0.330.0040.00815.51
7.0.320.0030.01015.30
7.0.310.0090.00615.53
7.0.300.0000.00915.20
7.0.290.0000.00815.47
7.0.280.0130.00015.33
7.0.270.0030.00615.35
7.0.260.0110.00015.58
7.0.250.0000.01415.34
7.0.240.0050.00315.56
7.0.230.0030.01215.20
7.0.220.0120.00315.59
7.0.210.0030.01315.31
7.0.200.0030.00916.00
7.0.190.0050.00515.38
7.0.180.0000.01315.58
7.0.170.0070.01015.55
7.0.160.0070.00615.31
7.0.150.0090.00615.53
7.0.140.0050.03718.76
7.0.130.0090.00615.60
7.0.120.0070.00715.39
7.0.110.0030.00615.43
7.0.100.0030.00715.45
7.0.90.0180.02717.75
7.0.80.0170.04417.64
7.0.70.0290.04117.77
7.0.60.0300.03017.71
7.0.50.0280.03017.83
7.0.40.0070.02516.80
7.0.30.0100.03616.84
7.0.20.0090.03416.66
7.0.10.0130.03216.72
7.0.00.0080.03016.89
5.6.400.0000.00814.61
5.6.390.0060.00614.51
5.6.380.0040.01114.54
5.6.370.0060.00314.54
5.6.360.0100.00714.46
5.6.350.0110.00014.22
5.6.340.0030.01013.99
5.6.330.0090.00914.57
5.6.320.0130.00314.42
5.6.310.0120.00314.66
5.6.300.0100.00314.59
5.6.290.0000.01213.99
5.6.280.0050.04117.81
5.6.270.0030.01014.52
5.6.260.0040.00714.56
5.6.250.0110.00414.50
5.6.240.0030.02917.59
5.6.230.0000.03017.62
5.6.220.0060.03617.59
5.6.210.0100.02717.44
5.6.200.0050.02917.74
5.6.190.0080.03517.67
5.6.180.0070.02417.82
5.6.170.0050.04717.72
5.6.160.0050.02917.66
5.6.150.0050.02917.61
5.6.140.0060.04117.71
5.6.130.0070.04217.78
5.6.120.0050.03717.68
5.6.110.0100.04217.63
5.6.100.0080.02217.73
5.6.90.0050.03717.71
5.6.80.0030.03117.44
5.6.70.0050.02617.38
5.6.60.0050.02217.44
5.6.50.0100.02217.48
5.6.40.0070.03817.42
5.6.30.0030.02617.33
5.6.20.0040.02617.48
5.6.10.0080.02217.39
5.6.00.0110.03617.53
5.5.380.0030.03317.34
5.5.370.0000.03517.35
5.5.360.0020.04817.39
5.5.350.0080.04117.46
5.5.340.0100.04017.59
5.5.330.0070.04317.55
5.5.320.0050.03217.57
5.5.310.0050.02717.53
5.5.300.0070.04217.70
5.5.290.0110.03717.79
5.5.280.0030.04817.60
5.5.270.0070.03317.63
5.5.260.0000.03117.74
5.5.250.0050.02917.54
5.5.240.0050.02317.23
5.5.230.0110.02817.33
5.5.220.0080.03717.24
5.5.210.0080.02117.20
5.5.200.0100.02017.40
5.5.190.0080.02117.43
5.5.180.0050.02717.38
5.5.170.0000.01414.37
5.5.160.0100.02517.22
5.5.150.0050.02317.20
5.5.140.0030.04717.34
5.5.130.0110.03517.31
5.5.120.0080.02517.36
5.5.110.0030.03917.17
5.5.100.0070.03817.21
5.5.90.0130.03117.33
5.5.80.0070.02817.11
5.5.70.0070.02716.97
5.5.60.0060.02417.31
5.5.50.0070.02917.14
5.5.40.0080.02217.28
5.5.30.0070.03517.28
5.5.20.0070.04017.18
5.5.10.0020.03117.13
5.5.00.0100.02117.25
5.4.450.0000.04715.75
5.4.440.0070.03015.80
5.4.430.0080.02015.79
5.4.420.0060.04515.70
5.4.410.0080.02215.79
5.4.400.0020.02915.56
5.4.390.0070.02915.66
5.4.380.0060.02615.73
5.4.370.0050.02515.73
5.4.360.0080.03015.63
5.4.350.0020.03515.64
5.4.340.0050.02415.63
5.4.330.0100.00312.23
5.4.320.0070.02815.74
5.4.310.0050.02115.65
5.4.300.0030.02515.59
5.4.290.0120.03815.72
5.4.280.0130.03815.64
5.4.270.0060.04415.63
5.4.260.0000.04715.63
5.4.250.0030.04415.65
5.4.240.0060.02015.66
5.4.230.0120.03215.70
5.4.220.0030.02315.54
5.4.210.0080.02015.62
5.4.200.0050.03815.68
5.4.190.0040.04215.53
5.4.180.0030.02615.67
5.4.170.0050.02615.72
5.4.160.0020.04115.67
5.4.150.0050.04015.72
5.4.140.0080.02814.32
5.4.130.0070.03414.27
5.4.120.0020.02514.21
5.4.110.0070.03914.29
5.4.100.0060.02614.35
5.4.90.0050.03614.30
5.4.80.0080.02214.28
5.4.70.0020.02514.29
5.4.60.0080.03614.37
5.4.50.0040.03214.30
5.4.40.0050.02014.35
5.4.30.0050.03314.31
5.4.20.0050.02514.29
5.4.10.0040.03614.34
5.4.00.0020.02413.99
5.3.290.0060.02513.51
5.3.280.0100.03013.41
5.3.270.0060.02113.48
5.3.260.0070.04113.48
5.3.250.0050.02413.41
5.3.240.0030.02513.46
5.3.230.0020.02513.41
5.3.220.0070.02313.38
5.3.210.0050.04313.41
5.3.200.0030.03613.38
5.3.190.0070.04313.37
5.3.180.0070.02813.38
5.3.170.0070.03213.43
5.3.160.0050.04213.44
5.3.150.0050.02313.46
5.3.140.0100.03913.44
5.3.130.0060.03913.39
5.3.120.0050.02513.40
5.3.110.0110.03913.43
5.3.100.0100.03213.21
5.3.90.0020.02813.21
5.3.80.0050.02013.17
5.3.70.0000.02413.11
5.3.60.0040.02013.09
5.3.50.0030.03813.14
5.3.40.0010.02613.06
5.3.30.0030.02613.05
5.3.20.0030.02213.03
5.3.10.0050.02712.90
5.3.00.0050.02713.00
5.2.170.0030.02711.30
5.2.160.0030.03711.04
5.2.150.0070.06011.05
5.2.140.0030.03011.23
5.2.130.0000.03311.14
5.2.120.0000.04011.19
5.2.110.0100.05011.23
5.2.100.0030.03311.18
5.2.90.0030.02711.02
5.2.80.0070.02711.02
5.2.70.0000.07011.23
5.2.60.0030.04011.07
5.2.50.0030.02711.15
5.2.40.0000.04711.03
5.2.30.0000.03011.05
5.2.20.0070.04311.05
5.2.10.0030.04010.95
5.2.00.0030.04010.70
5.1.60.0000.0539.87
5.1.50.0000.04010.13
5.1.40.0000.03010.09
5.1.30.0030.02710.46
5.1.20.0030.04710.39
5.1.10.0000.0279.98
5.1.00.0030.02310.20
5.0.50.0000.0238.59
5.0.40.0000.0208.57
5.0.30.0000.0308.34
5.0.20.0070.0178.23
5.0.10.0000.0208.10
5.0.00.0030.0508.29
4.4.90.0030.0136.99
4.4.80.0030.0376.99
4.4.70.0030.0136.99
4.4.60.0000.0236.99
4.4.50.0000.0336.99
4.4.40.0030.0236.99
4.4.30.0070.0306.99
4.4.20.0030.0136.99
4.4.10.0000.0206.99
4.4.00.0000.0406.99
4.3.110.0030.0136.99
4.3.100.0000.0206.99
4.3.90.0030.0136.99
4.3.80.0030.0206.99
4.3.70.0030.0136.99
4.3.60.0000.0176.99
4.3.50.0000.0176.99
4.3.40.0030.0276.99
4.3.30.0000.0136.99
4.3.20.0000.0276.99
4.3.10.0100.0276.99
4.3.00.0030.0176.99

preferences:
38.54 ms | 401 KiB | 5 Q