3v4l.org

run code in 500+ PHP versions simultaneously
<?php // what i wanna do with this script is for each color, create an array that has the total price(my table has some items that have the same color but with different prices) $a = array(); while($row = mysqli_fetch_assoc($result)) { // create an array of each color, eg: $a["black"] $a["$row[color]"] = array(); // if the price key in the $a["black"] exists then add its value to the new one if(array_key_exists("price", $a["$row[color]"])) { $a["$row[color]"]["price"] += $row["price"]; } else { $a["$row[color]"]["price"] = $row["price"]; } } ?>

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.5.30.0070.01117.63
8.5.20.0090.00719.58
8.5.10.0070.01216.65
8.5.00.0150.00720.16
8.4.180.0150.00719.63
8.4.170.0060.00524.02
8.4.160.0090.01223.25
8.4.150.0090.00316.93
8.4.140.0130.00917.69
8.4.130.0120.00817.93
8.4.120.0100.01120.57
8.4.110.0140.00618.60
8.4.100.0050.00318.05
8.4.90.0090.01118.95
8.4.80.0100.00817.99
8.4.70.0130.00717.86
8.4.60.0090.01118.80
8.4.50.0080.00119.95
8.4.40.0100.01017.75
8.4.30.0140.00720.49
8.4.20.0030.00718.03
8.4.10.0120.00919.68
8.3.300.0090.01218.25
8.3.290.0180.01020.72
8.3.280.0170.00718.41
8.3.270.0110.00916.50
8.3.260.0130.00716.59
8.3.250.0060.00418.81
8.3.240.0070.00418.63
8.3.230.0050.00316.61
8.3.220.0130.00517.05
8.3.210.0100.00816.73
8.3.200.0060.00216.54
8.3.190.0120.00619.00
8.3.180.0090.00616.65
8.3.170.0060.01317.07
8.3.160.0040.01418.76
8.3.150.0130.00716.80
8.3.140.0060.00620.48
8.3.130.0080.00018.29
8.3.120.0120.00618.79
8.3.110.0120.00420.94
8.3.100.0050.00324.06
8.3.90.0080.00026.77
8.3.80.0100.00016.38
8.3.70.0100.01016.58
8.3.60.0160.00616.75
8.3.50.0080.01024.37
8.3.40.0100.01022.03
8.3.30.0070.00718.79
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.300.0140.00720.41
8.2.290.0130.00620.68
8.2.280.0020.00618.50
8.2.270.0120.00616.70
8.2.260.0080.00016.80
8.2.250.0150.00416.48
8.2.240.0030.00618.74
8.2.230.0060.00322.58
8.2.220.0080.00837.54
8.2.210.0040.01826.77
8.2.200.0110.00016.63
8.2.190.0090.00918.29
8.2.180.0110.00825.92
8.2.170.0120.00319.09
8.2.160.0030.01022.96
8.2.150.0000.00725.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0110.00419.39
8.2.110.0060.00320.80
8.2.100.0060.00617.84
8.2.90.0000.00817.80
8.2.80.0030.00617.97
8.2.70.0050.00317.25
8.2.60.0000.00817.63
8.2.50.0030.00518.05
8.2.40.0060.00319.52
8.2.30.0000.00717.87
8.2.20.0000.00818.03
8.2.10.0000.00819.11
8.2.00.0000.00819.29
8.1.340.0120.00817.92
8.1.330.0090.01019.97
8.1.320.0090.01116.36
8.1.310.0120.00318.05
8.1.300.0040.00418.31
8.1.290.0000.00830.84
8.1.280.0120.00625.92
8.1.270.0070.00023.99
8.1.260.0000.00826.35
8.1.250.0040.01128.09
8.1.240.0080.00022.29
8.1.230.0040.00720.88
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0000.00817.35
8.1.190.0000.00817.23
8.1.180.0080.00018.10
8.1.170.0000.00818.69
8.1.160.0040.00418.82
8.1.150.0080.00018.82
8.1.140.0000.00820.52
8.1.130.0000.00720.07
8.1.120.0030.00617.31
8.1.110.0040.00417.43
8.1.100.0040.00417.36
8.1.90.0030.00617.39
8.1.80.0100.00017.43
8.1.70.0000.00717.27
8.1.60.0050.00317.51
8.1.50.0050.00217.52
8.1.40.0060.00317.45
8.1.30.0000.00817.65
8.1.20.0000.00717.64
8.1.10.0070.00017.53
8.1.00.0070.00317.39
8.0.300.0070.00019.91
8.0.290.0080.00016.75
8.0.280.0070.00018.38
8.0.270.0030.00317.88
8.0.260.0060.00018.55
8.0.250.0000.00716.89
8.0.240.0080.00016.84
8.0.230.0040.00416.84
8.0.220.0030.00616.91
8.0.210.0000.00716.90
8.0.200.0000.00716.93
8.0.190.0050.00516.88
8.0.180.0040.00416.80
8.0.170.0000.00816.79
8.0.160.0050.00216.78
8.0.150.0050.00316.73
8.0.140.0040.00416.92
8.0.130.0030.00313.28
8.0.120.0000.00816.85
8.0.110.0000.00716.79
8.0.100.0040.00416.84
8.0.90.0040.00416.75
8.0.80.0110.00916.89
8.0.70.0040.00416.77
8.0.60.0080.00016.88
8.0.50.0070.00016.77
8.0.30.0070.01017.07
8.0.20.0120.00916.90
8.0.10.0070.00016.99
8.0.00.0150.00416.48
7.4.330.0050.00015.55
7.4.320.0000.00616.46
7.4.300.0060.00016.60
7.4.290.0040.00416.55
7.4.280.0050.00316.63
7.4.270.0030.00316.65
7.4.260.0050.00013.25
7.4.250.0050.00316.48
7.4.240.0040.00416.48
7.4.230.0060.00016.47
7.4.220.0020.00516.55
7.4.210.0050.01116.55
7.4.200.0040.00416.57
7.4.130.0090.00816.51
7.4.120.0120.00916.58
7.4.110.0180.00416.51
7.4.100.0130.01316.48
7.4.90.0080.01316.12
7.4.80.0040.01516.31
7.4.70.0130.00716.30
7.4.60.0120.00916.27
7.4.50.0120.00816.36
7.4.40.0170.00516.33
7.4.30.0210.00516.34
7.4.20.0110.00816.23
7.4.10.0070.01416.43
7.4.00.0150.00816.30
7.3.330.0030.00316.33
7.3.320.0060.00013.11
7.3.310.0000.00716.41
7.3.300.0060.00016.31
7.3.290.0080.00716.26
7.3.260.0090.00916.57
7.3.240.0160.00416.38
7.3.230.0090.00916.52
7.3.220.0160.00816.34
7.3.210.0150.00316.51
7.3.200.0120.00816.29
7.3.190.0180.00016.26
7.3.180.0090.00916.17
7.3.170.0160.00316.25
7.3.160.0100.01016.52
7.3.150.0050.01416.40
7.3.140.0110.00716.14
7.3.130.0110.00916.26
7.3.120.0100.00816.36
7.3.110.0120.00616.45
7.3.100.0090.00916.32
7.3.90.0160.00316.40
7.3.80.0150.00716.45
7.3.70.0140.00516.31
7.3.60.0100.01016.39
7.3.50.0100.00916.13
7.3.40.0040.01716.34
7.3.30.0080.01016.37
7.3.20.0170.00916.26
7.3.10.0150.00616.30
7.3.00.0110.00816.38
7.2.340.0110.01116.47
7.2.330.0110.01216.67
7.2.320.0100.01016.59
7.2.310.0090.01016.44
7.2.300.0120.00916.12
7.2.290.0100.01116.39
7.2.280.0140.00516.14
7.2.270.0130.00816.50
7.2.260.0110.00816.25
7.2.250.0080.01216.30
7.2.240.0150.00316.37
7.2.230.0130.00716.48
7.2.220.0060.01516.20
7.2.210.0140.00516.17
7.2.200.0030.01716.20
7.2.190.0100.01416.37
7.2.180.0000.01916.26
7.2.170.0110.00816.36
7.2.160.0110.01216.43
7.2.150.0140.00716.50
7.2.140.0160.00416.40
7.2.130.0130.01116.40
7.2.120.0140.01316.38
7.2.110.0060.01816.57
7.2.100.0150.00616.34
7.2.90.0100.01316.32
7.2.80.0170.00916.51
7.2.70.0000.01916.29
7.2.60.0030.01716.25
7.2.50.0140.00916.29
7.2.40.0090.01516.47
7.2.30.0120.01116.45
7.2.20.0120.00716.30
7.2.10.0320.01016.34
7.2.00.0170.01116.35

preferences:
105.03 ms | 1524 KiB | 5 Q