3v4l.org

run code in 500+ PHP versions simultaneously
<?php $rows = [ [ 'time' => '00:00:00', 'sales' => 55.99, 'orders' => 1, ], [ 'time' => '06:00:00', 'sales' => 46.37, 'orders' => 1, ], [ 'time' => '08:00:00', 'sales' => 246.56, 'orders' => 4, ], [ 'time' => '10:00:00', 'sales' => 78.66, 'orders' => 1, ] ]; // isolate the times $times = array_map(function ($row) { return $row['time']; }, $rows); // create a list of similarly formatted times from 00:00:00 - 22:00:00 $allTimes = array_map(function ($hour) { return sprintf('%02d:00:00', $hour); }, range(0, 22, 2)); // compute the difference $notTimes = array_diff($allTimes, $times); // add the notTimes to the original rowset with default values foreach ($notTimes as $notTime) { $rows[] = [ 'time' => $notTime, 'sales' => 0, 'orders' => 0, ]; } // sort, because why not usort($rows, function ($rowOne, $rowTwo) { return ((int) $rowOne['time']) > ((int) $rowTwo['time']); }); // dump var_dump($rows);

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.0100.00816.79
8.5.20.0060.01218.55
8.5.10.0120.00820.27
8.5.00.0110.01019.97
8.4.180.0180.00719.82
8.4.170.0120.00920.75
8.4.160.0130.01020.51
8.4.150.0090.00416.88
8.4.140.0140.00917.54
8.4.130.0100.00717.79
8.4.120.0110.00920.57
8.4.110.0120.00922.38
8.4.100.0140.00718.11
8.4.90.0110.01018.68
8.4.80.0130.00817.99
8.4.70.0070.00318.14
8.4.60.0140.00818.50
8.4.50.0100.01017.82
8.4.40.0200.00017.88
8.4.30.0120.00919.59
8.4.20.0070.01417.89
8.4.10.0040.01218.66
8.3.300.0110.01020.83
8.3.290.0120.01222.62
8.3.280.0130.00718.40
8.3.270.0120.00916.67
8.3.260.0100.00816.96
8.3.250.0080.00318.87
8.3.240.0040.00416.62
8.3.230.0050.00416.85
8.3.220.0020.00617.18
8.3.210.0100.00616.86
8.3.200.0030.00616.94
8.3.190.0060.00417.13
8.3.180.0130.00616.88
8.3.170.0110.00719.09
8.3.160.0060.01216.81
8.3.150.0130.00320.80
8.3.140.0050.00516.75
8.3.130.0060.00318.63
8.3.120.0100.00718.76
8.3.110.0030.00620.94
8.3.100.0100.01024.06
8.3.90.0130.00326.77
8.3.80.0060.00618.68
8.3.70.0040.01918.64
8.3.60.0070.01118.54
8.3.50.0120.00521.99
8.3.40.0100.01018.77
8.3.30.0070.00719.22
8.3.20.0030.00520.36
8.3.10.0090.00021.88
8.3.00.0030.00522.46
8.2.300.0140.00722.20
8.2.290.0080.01120.44
8.2.280.0130.00818.64
8.2.270.0110.01117.15
8.2.260.0000.00819.31
8.2.250.0090.00016.77
8.2.240.0000.01018.82
8.2.230.0050.00322.58
8.2.220.0040.00737.54
8.2.210.0040.00426.77
8.2.200.0030.00616.63
8.2.190.0130.01017.00
8.2.180.0100.01016.63
8.2.170.0090.00622.96
8.2.160.0110.00421.07
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0150.00426.16
8.2.120.0080.00019.49
8.2.110.0000.00922.23
8.2.100.0060.00617.97
8.2.90.0050.00317.81
8.2.80.0030.00619.09
8.2.70.0070.00317.46
8.2.60.0080.00017.80
8.2.50.0040.00417.63
8.2.40.0040.00420.01
8.2.30.0060.00318.06
8.2.20.0040.00417.73
8.2.10.0000.00819.51
8.2.00.0000.00817.71
8.1.340.0130.00817.80
8.1.330.0100.00921.96
8.1.320.0090.01016.31
8.1.310.0080.00818.47
8.1.300.0030.00616.56
8.1.290.0090.00030.84
8.1.280.0040.01125.92
8.1.270.0050.00522.08
8.1.260.0080.00026.35
8.1.250.0090.00628.09
8.1.240.0030.00623.98
8.1.230.0120.00022.75
8.1.220.0000.00817.79
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0050.00318.53
8.1.160.0030.00522.05
8.1.150.0000.00818.73
8.1.140.0040.00417.40
8.1.130.0000.00917.87
8.1.120.0040.00417.40
8.1.110.0080.00017.39
8.1.100.0000.00717.40
8.1.90.0030.00517.36
8.1.80.0050.00217.41
8.1.70.0030.00317.47
8.1.60.0050.00317.59
8.1.50.0030.00517.49
8.1.40.0000.00817.52
8.1.30.0000.00817.68
8.1.20.0000.00917.68
8.1.10.0000.00817.48
8.1.00.0050.00317.43
8.0.300.0040.00420.16
8.0.290.0000.00916.88
8.0.280.0000.00718.42
8.0.270.0040.00418.04
8.0.260.0040.00416.86
8.0.250.0050.00217.09
8.0.240.0030.00317.05
8.0.230.0000.00717.02
8.0.220.0040.00416.86
8.0.210.0030.00316.88
8.0.200.0000.00717.01
8.0.190.0030.00516.96
8.0.180.0030.00516.91
8.0.170.0030.00517.00
8.0.160.0040.00417.02
8.0.150.0070.00016.94
8.0.140.0040.00416.84
8.0.130.0000.00513.46
8.0.120.0040.00416.84
8.0.110.0030.00616.95
8.0.100.0080.00016.93
8.0.90.0020.00516.88
8.0.80.0190.00316.92
8.0.70.0000.00716.87
8.0.60.0050.00217.06
8.0.50.0040.00416.88
8.0.30.0110.01117.13
8.0.20.0090.01217.40
8.0.10.0040.00416.98
8.0.00.0150.00616.82
7.4.330.0060.00015.11
7.4.320.0000.00716.55
7.4.300.0030.00316.55
7.4.290.0000.00716.56
7.4.280.0050.00216.58
7.4.270.0030.00316.55
7.4.260.0030.00316.66
7.4.250.0000.00816.61
7.4.240.0030.00516.43
7.4.230.0070.00016.45
7.4.220.0130.00316.38
7.4.210.0070.01116.54
7.4.200.0040.00416.53
7.4.190.0070.00016.72
7.4.160.0100.00716.67
7.4.150.0080.01217.40
7.4.140.0130.00817.86
7.4.130.0190.00116.67
7.4.120.0160.00616.57
7.4.110.0190.00016.54
7.4.100.0150.00616.71
7.4.90.0160.00316.55
7.4.80.0100.01019.39
7.4.70.0050.01416.55
7.4.60.0100.00616.57
7.4.50.0030.00616.35
7.4.40.0090.00622.77
7.4.30.0130.00516.44
7.4.00.0120.00314.86
7.3.330.0060.00013.45
7.3.320.0030.00313.47
7.3.310.0040.00416.43
7.3.300.0030.00316.26
7.3.290.0090.00616.40
7.3.280.0070.01116.40
7.3.270.0090.00917.40
7.3.260.0120.00616.45
7.3.250.0090.01216.53
7.3.240.0070.01816.40
7.3.230.0060.01216.39
7.3.210.0100.01016.41
7.3.200.0190.00519.39
7.3.190.0120.01116.54
7.3.180.0120.01216.54
7.3.170.0080.00816.48
7.3.160.0000.01716.47
7.3.120.0000.01414.94
7.3.10.0110.00416.46
7.3.00.0090.00316.11
7.2.330.0120.00916.80
7.2.320.0030.01416.86
7.2.310.0140.00516.86
7.2.300.0030.01616.57
7.2.290.0110.00716.86
7.2.130.0130.01016.49
7.2.120.0090.01116.65
7.2.110.0070.00316.61
7.2.100.0030.01316.36
7.2.90.0030.00917.03
7.2.80.0100.00716.61
7.2.70.0090.00616.74
7.2.60.0110.00516.85
7.2.50.0070.00916.98
7.2.40.0190.00316.63
7.2.30.0090.00616.82
7.2.20.0070.00716.60
7.2.10.0140.00516.76
7.2.00.0180.00416.61
7.1.250.0080.00415.71
7.1.200.0050.00615.96
7.1.70.0000.00817.18
7.1.60.0100.01019.82
7.1.50.0000.01416.80
7.1.00.0070.07322.32
7.0.200.0000.01016.79
7.0.140.0030.07322.15
7.0.60.0030.07720.08
7.0.50.0100.06317.89
7.0.40.0130.06320.14
7.0.30.0200.03720.12
7.0.20.0130.05020.16
7.0.10.0070.08020.30
7.0.00.0030.07020.23
5.6.280.0100.06720.93
5.6.210.0100.05720.51
5.6.200.0100.06718.18
5.6.190.0130.08020.63
5.6.180.0100.04020.61
5.6.170.0330.07320.55
5.6.160.0100.04020.50
5.6.150.0070.06318.22
5.6.140.0100.07018.13
5.6.130.0030.04318.28
5.6.120.0070.05321.00
5.6.110.0000.05020.99
5.6.100.0030.06320.96
5.6.90.0130.07721.04
5.6.80.0070.03720.39
5.6.70.4370.04720.53
5.5.350.0130.08020.34
5.5.340.0030.03718.09
5.5.330.0030.06720.38
5.5.320.3500.04720.27
5.5.310.0230.07020.34
5.5.300.0170.07017.96
5.5.290.0070.04318.08
5.5.280.0100.05320.69
5.5.270.0230.06720.79
5.5.260.0100.08320.98
5.5.250.0070.08720.62
5.5.240.0170.04320.24
5.4.450.0700.06319.31
5.4.440.0100.06319.61
5.4.430.0200.04719.53
5.4.420.0100.05719.52
5.4.410.0070.06019.52
5.4.400.1470.00018.49
5.4.390.1600.00018.75
5.4.380.0230.05318.74
5.4.370.0270.05318.84
5.4.360.0330.05018.54
5.4.350.0430.03718.54
5.4.340.0230.05318.81
5.4.320.0040.03912.52
5.4.310.0090.03712.52
5.4.300.0080.03512.52
5.4.290.0070.04012.51
5.4.280.0080.03912.41
5.4.270.0030.04312.41
5.4.260.0100.07018.96
5.4.250.0070.05018.77
5.4.240.0030.06718.95
5.4.230.0000.05718.83
5.4.220.0130.06718.82
5.4.210.0200.04718.79
5.4.200.0130.06018.89
5.4.190.0130.05019.08
5.4.180.0130.04718.75
5.4.170.0170.06018.92
5.4.160.0000.06018.81
5.4.150.0200.04018.74
5.4.140.0170.06016.33
5.4.130.0070.05316.63
5.4.120.0130.06716.53
5.4.110.0170.04316.42
5.4.100.0100.05316.51
5.4.90.0130.04716.66
5.4.80.0230.05716.34
5.4.70.0170.06316.50
5.4.60.0030.05716.26
5.4.50.0070.06316.25
5.4.40.0130.04316.40
5.4.30.0130.05716.31
5.4.20.0030.07716.50
5.4.10.0130.05316.43
5.4.00.0170.04315.84
5.3.290.0050.04012.80
5.3.280.0100.05014.46
5.3.270.0130.05014.62
5.3.260.0030.06014.61
5.3.250.0070.07014.53
5.3.240.0070.07714.62
5.3.230.0070.05014.60
5.3.220.0130.04314.45
5.3.210.0100.05314.57
5.3.200.0100.05314.61
5.3.190.0030.07314.57
5.3.180.0070.05314.58
5.3.170.0030.05714.72
5.3.160.0100.05314.44
5.3.150.0100.07014.58
5.3.140.0030.06714.56
5.3.130.0070.07314.64
5.3.120.0070.05714.25
5.3.110.0130.05014.59
5.3.100.0170.05313.81
5.3.90.0030.05013.90
5.3.80.0070.05014.03
5.3.70.0070.07014.05
5.3.60.0200.05713.84
5.3.50.0070.04713.88
5.3.40.0130.04313.83
5.3.30.0100.05013.95
5.3.20.0030.05713.61
5.3.10.0170.05713.52
5.3.00.0070.06313.65
5.2.170.0030.04311.07
5.2.160.0070.04711.02
5.2.150.0030.04311.15
5.2.140.0200.04711.05
5.2.130.0030.04311.02
5.2.120.0030.04311.02
5.2.110.0030.05311.02
5.2.100.0030.04311.03
5.2.90.0100.05011.03
5.2.80.0030.04711.20
5.2.70.0070.06011.11
5.2.60.0000.04710.81
5.2.50.0070.04310.96
5.2.40.0000.04710.83
5.2.30.0130.04010.86
5.2.20.0070.04310.97
5.2.10.0000.04710.94
5.2.00.0000.04710.48
5.1.60.0100.03310.22
5.1.50.0130.0309.92
5.1.40.0100.03710.01
5.1.30.0130.03010.23
5.1.20.0070.04010.57
5.1.10.0070.04310.30
5.1.00.0130.0339.96
5.0.50.0070.0278.59
5.0.40.0000.0308.64
5.0.30.0070.0438.18
5.0.20.0070.0238.23
5.0.10.0070.0238.23
5.0.00.0070.0408.13
4.4.90.0000.0337.05
4.4.80.0070.0277.05
4.4.70.0000.0237.05
4.4.60.0030.0277.05
4.4.50.0030.0207.05
4.4.40.0030.0377.05
4.4.30.0030.0337.05
4.4.20.0000.0207.05
4.4.10.0030.0207.05
4.4.00.0030.0337.05
4.3.110.0000.0237.05
4.3.100.0000.0237.05
4.3.90.0000.0337.05
4.3.80.0070.0307.05
4.3.70.0000.0277.05
4.3.60.0030.0207.05
4.3.50.0030.0337.05
4.3.40.0030.0307.05
4.3.30.0000.0307.05
4.3.20.0000.0337.05
4.3.10.0000.0307.05
4.3.00.0030.0237.33

preferences:
49.45 ms | 2591 KiB | 5 Q