3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ ['3', '2022-01-03'], ['5,3', '2022-01-15'], ['4', '2022-01-27'], ['5', '2022-02-01'], ['7', '2022-02-09'], ['3,2', '2022-01-16'], ]; $counts = []; foreach($rows as $row){ $ids = explode(',', $row[0]); $month = date('m', strtotime($row[1])); foreach($ids as $id){ if(!array_key_exists($id, $counts)){ $counts[$id] = []; } if(!array_key_exists($month, $counts[$id])){ $counts[$id][$month] = 0; } $counts[$id][$month]++; } } var_dump($counts);

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.00.0110.01020.42
8.4.150.0010.00114.05
8.4.140.0110.01017.70
8.4.130.0100.00818.90
8.4.120.0080.01223.88
8.4.110.0170.00418.86
8.4.100.0140.00719.04
8.4.90.0140.00520.46
8.4.80.0040.00418.82
8.4.70.0100.00918.82
8.4.60.0130.00720.80
8.4.50.0110.00818.62
8.4.40.0120.00318.07
8.4.30.0130.00720.35
8.4.20.0130.00718.07
8.4.10.0030.00617.78
8.3.280.0210.01018.80
8.3.270.0130.00916.82
8.3.260.0110.00816.73
8.3.250.0100.00917.13
8.3.240.0040.00517.25
8.3.230.0120.00616.88
8.3.220.0100.00619.08
8.3.210.0130.00616.68
8.3.200.0040.00516.71
8.3.190.0120.00617.09
8.3.180.0090.00818.91
8.3.170.0150.00316.74
8.3.160.0060.01217.20
8.3.150.0060.00319.09
8.3.140.0030.00518.96
8.3.130.0090.00018.67
8.3.120.0070.00418.97
8.3.110.0030.00620.94
8.3.100.0040.00424.06
8.3.90.0060.00326.77
8.3.80.0110.00018.56
8.3.70.0030.01416.88
8.3.60.0070.00718.68
8.3.50.0060.00920.23
8.3.40.0120.00620.14
8.3.30.0070.00719.09
8.3.20.0050.00324.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.290.0150.00418.94
8.2.280.0120.00818.61
8.2.270.0060.01216.64
8.2.260.0070.01116.91
8.2.250.0060.00318.50
8.2.240.0130.00617.07
8.2.230.0050.00322.58
8.2.220.0090.00037.54
8.2.210.0100.01026.77
8.2.200.0030.00617.00
8.2.190.0120.00616.75
8.2.180.0060.01225.92
8.2.170.0130.00619.08
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0020.00524.66
8.2.130.0000.00826.16
8.2.120.0040.00419.38
8.2.110.0060.00321.03
8.2.100.0090.00317.97
8.2.90.0000.00918.09
8.2.80.0050.00319.11
8.2.70.0030.00617.88
8.2.60.0000.00818.18
8.2.50.0000.00718.05
8.2.40.0070.00317.88
8.2.30.0000.00718.15
8.2.20.0050.00320.52
8.2.10.0040.00417.83
8.2.00.0000.00719.36
8.1.330.0110.00821.77
8.1.320.0170.00816.37
8.1.310.0000.00816.73
8.1.300.0070.01118.46
8.1.290.0040.00730.84
8.1.280.0120.00325.92
8.1.270.0060.00322.12
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0140.00322.66
8.1.230.0090.00322.82
8.1.220.0040.00417.91
8.1.210.0000.00918.77
8.1.200.0040.00417.60
8.1.190.0050.00317.60
8.1.180.0030.00518.10
8.1.170.0050.00217.63
8.1.160.0070.00018.97
8.1.150.0100.00018.75
8.1.140.0040.00417.66
8.1.130.0030.00318.88
8.1.120.0040.00417.59
8.1.110.0000.00817.62
8.1.100.0030.00317.55
8.1.90.0040.00417.71
8.1.80.0000.00817.68
8.1.70.0040.00417.56
8.1.60.0030.00517.73
8.1.50.0080.00017.66
8.1.40.0040.00417.71
8.1.30.0060.00317.63
8.1.20.0120.00517.76
8.1.10.0120.00617.65
8.1.00.0100.00317.62
8.0.300.0050.00219.98
8.0.290.0090.00016.88
8.0.280.0070.00018.45
8.0.270.0040.00416.96
8.0.260.0000.00718.55
8.0.250.0000.00717.18
8.0.240.0000.00717.17
8.0.230.0000.00717.16
8.0.220.0030.00317.00
8.0.210.0030.00517.06
8.0.200.0040.00417.18
8.0.190.0040.00417.21
8.0.180.0050.00317.20
8.0.170.0030.00616.97
8.0.160.0030.00517.04
8.0.150.0070.00417.05
8.0.140.0010.01016.98
8.0.130.0080.00417.09
8.0.120.0060.00316.99
8.0.110.0050.00416.99
8.0.100.0030.00617.07
8.0.90.0070.00317.09
8.0.80.0100.00416.92
8.0.70.0060.00717.02
8.0.60.0070.00217.10
8.0.50.0090.00617.03
8.0.30.0090.00717.10
8.0.20.0150.00117.08
8.0.10.0090.00517.10
7.4.330.0000.00615.55
7.4.320.0030.00316.65
7.4.300.0060.00016.52
7.4.290.0050.00416.71
7.4.280.0110.00416.71
7.4.270.0060.00716.72
7.4.260.0100.00216.72
7.4.250.0100.00416.69
7.4.240.0060.00616.68
7.4.230.0130.00216.72
7.4.220.0060.00716.67
7.4.210.0070.00416.71
7.4.200.0090.00316.72
7.4.190.0050.00516.71
7.4.180.0040.00716.65
7.4.160.0090.00416.71
7.4.150.0020.01016.65
7.4.140.0090.00516.65
7.4.130.0090.00616.58
7.4.120.0070.01016.61
7.4.110.0040.01016.60
7.4.100.0130.00216.68
7.4.90.0140.00016.58
7.4.80.0130.00316.47
7.4.70.0130.00216.62
7.4.60.0130.00416.48
7.4.50.0140.00416.43
7.4.40.0090.00316.50
7.4.30.0100.00616.61
7.4.20.0090.00716.63
7.4.10.0120.00116.54
7.4.00.0050.00416.64

preferences:
31.05 ms | 403 KiB | 5 Q