3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Data $name = ['Mazda','Mazda','Lexus', 'Lexus']; $count = [1,1,1,1]; $gp =[54,35,23,46]; // declare result array $result = []; for($i = 0; $i < count($name); $i++) { $result[ $name[$i] ] = [ "C" => ($result[ $name[$i] ]['C'] ?? 0) + $count[$i], "GP" => ($result[ $name[$i] ]['GP'] ?? 0) + $gp[$i] ]; } print_r($result);

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.4.10.0060.00319.32
8.3.140.0070.00718.21
8.3.130.0070.00416.59
8.3.120.0100.00620.61
8.3.110.0050.00320.94
8.3.100.0040.00716.41
8.3.90.0040.00426.77
8.3.80.0100.00316.50
8.3.70.0060.01216.58
8.3.60.0110.00716.50
8.3.50.0110.00523.69
8.3.40.0110.00718.65
8.3.30.0070.01118.65
8.3.20.0000.00824.18
8.3.10.0060.00324.66
8.3.00.0000.00826.16
8.2.260.0070.00718.41
8.2.250.0090.00016.44
8.2.240.0110.00416.93
8.2.230.0070.00322.58
8.2.220.0070.00024.06
8.2.210.0060.00926.77
8.2.200.0060.00316.38
8.2.190.0120.00416.58
8.2.180.0120.00325.92
8.2.170.0150.00318.91
8.2.160.0040.01222.96
8.2.150.0080.00025.66
8.2.140.0000.00724.66
8.2.130.0070.00026.16
8.2.120.0000.00721.18
8.2.110.0000.01121.18
8.2.100.0070.00917.85
8.2.90.0000.00819.07
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0030.00517.90
8.2.50.0080.00018.07
8.2.40.0070.00318.16
8.2.30.0070.00018.04
8.2.20.0000.00718.11
8.2.10.0050.00219.29
8.2.00.0040.00419.27
8.1.310.0090.00918.50
8.1.300.0040.00418.64
8.1.290.0030.00630.84
8.1.280.0110.00725.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0080.00419.16
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0040.00417.35
8.1.180.0050.00518.10
8.1.170.0040.00418.68
8.1.160.0000.00718.93
8.1.150.0040.00418.89
8.1.140.0040.00418.84
8.1.130.0030.00317.48
8.1.120.0000.00817.30
8.1.110.0080.00017.45
8.1.100.0050.00317.47
8.1.90.0040.00417.47
8.1.80.0000.00717.43
8.1.70.0030.00617.40
8.1.60.0040.00417.57
8.1.50.0040.00417.49
8.1.40.0050.00317.50
8.1.30.0000.00817.61
8.1.20.0090.00017.48
8.1.10.0000.00817.40
8.1.00.0080.00017.42
8.0.300.0000.00720.09
8.0.290.0000.00816.75
8.0.280.0000.00718.30
8.0.270.0000.00717.85
8.0.260.0000.00716.68
8.0.250.0040.00416.88
8.0.240.0080.00016.91
8.0.230.0030.00316.78
8.0.220.0000.00716.82
8.0.210.0060.00016.84
8.0.200.0040.00416.81
8.0.190.0030.00316.80
8.0.180.0040.00416.90
8.0.170.0030.00616.80
8.0.160.0030.00516.93
8.0.150.0050.00316.81
8.0.140.0000.00716.90
8.0.130.0050.00013.27
8.0.120.0000.00716.90
8.0.110.0000.00716.83
8.0.100.0040.00416.71
8.0.90.0040.00416.74
8.0.80.0100.00716.84
8.0.70.0040.00416.74
8.0.60.0040.00416.77
8.0.50.0000.00716.77
8.0.30.0060.01216.70
8.0.20.0140.00917.09
8.0.10.0070.00016.81
8.0.00.0030.01516.55
7.4.330.0050.00015.55
7.4.320.0030.00316.64
7.4.300.0070.00016.59
7.4.290.0040.00416.64
7.4.280.0040.00416.54
7.4.270.0030.00316.56
7.4.260.0020.00313.26
7.4.250.0040.00416.49
7.4.240.0000.00716.60
7.4.230.0070.00016.68
7.4.220.0040.00416.46
7.4.210.0050.01116.61
7.4.200.0040.00416.61
7.4.130.0070.01116.50
7.4.120.0190.00616.43
7.4.110.0120.00616.55
7.4.100.0090.01316.43
7.4.90.0140.00316.36
7.4.80.0080.01119.39
7.4.70.0080.00816.43
7.4.60.0130.00316.50
7.4.50.0170.00616.19
7.4.40.0130.01316.27
7.4.30.0110.00816.56
7.4.20.0000.01516.31
7.4.10.0100.00716.52
7.4.00.0000.01616.59
7.3.330.0000.00716.30
7.3.320.0060.00013.22
7.3.310.0070.00016.14
7.3.300.0070.00016.28
7.3.290.0090.00716.34
7.3.280.0070.00716.44
7.3.260.0030.01916.33
7.3.230.0070.01316.16
7.3.210.0100.01016.34
7.3.200.0060.00916.32
7.3.190.0080.00816.18
7.3.180.0060.00916.17
7.3.170.0120.00816.39
7.3.160.0120.00616.17
7.3.150.0050.01116.36
7.3.140.0110.00416.58
7.3.130.0150.00616.47
7.3.120.0150.00416.52
7.3.110.0130.01216.41
7.3.100.0050.01216.34
7.3.90.0060.01816.51
7.3.80.0070.01016.50
7.3.70.0100.00716.43
7.3.60.0110.01116.32
7.3.50.0130.00416.39
7.3.40.0070.01016.30
7.3.30.0060.01116.38
7.3.20.0070.01116.36
7.3.10.0100.00716.41
7.3.00.0130.00316.36
7.2.330.0130.00316.57
7.2.310.0170.00016.38
7.2.300.0110.01416.20
7.2.290.0030.01316.72
7.2.280.0090.00916.76
7.2.270.0090.00916.46
7.2.260.0150.00816.68
7.2.250.0110.01716.68
7.2.240.0080.01916.52
7.2.230.0130.00816.65
7.2.220.0140.00516.58
7.2.210.0080.00816.41
7.2.200.0070.01016.47
7.2.190.0110.00716.49
7.2.180.0090.00816.61
7.2.170.0080.00816.59
7.2.160.0110.00816.48
7.2.150.0120.00616.55
7.2.140.0060.01216.73
7.2.130.0110.00816.55
7.2.120.0100.01016.60
7.2.110.0110.00816.55
7.2.100.0040.01416.71
7.2.90.0120.01216.54
7.2.80.0120.01216.67
7.2.70.0090.00916.70
7.2.60.0070.01116.36
7.2.50.0120.00616.67
7.2.40.0130.00716.65
7.2.30.0130.00616.59
7.2.20.0160.01016.74
7.2.10.0140.00616.59
7.2.00.0180.00016.69

preferences:
76.03 ms | 403 KiB | 5 Q