3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ [ 'days' => [ 'day_id' => '2016-11-23,2016-11-24', ], ], [ 'days' => [ 'day_id' => '2016-11-25,', ], ], [ 'days' => [ 'day_id' => '', ], ], [ 'days' => [ 'day_id' => '2016-11-27,2016-11-28', ], ], ]; function reduce_func($carry, $item){ if (isset($item['days']) && !empty($item['days']['day_id'])){ $carry += count(array_unique(array_filter(explode(',', $item['days']['day_id'])))); } return $carry; } $result = array_reduce($arr, "reduce_func", 0); var_dump($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.3.60.0110.00416.50
8.3.50.0100.01018.05
8.3.40.0120.00618.79
8.3.30.0030.01218.90
8.3.20.0040.00419.23
8.3.10.0040.00423.50
8.3.00.0040.00419.20
8.2.180.0140.00416.32
8.2.170.0040.01122.96
8.2.160.0090.00620.52
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0100.01019.82
8.2.120.0000.00726.35
8.2.110.0100.00020.94
8.2.100.0100.00517.91
8.2.90.0060.00317.75
8.2.80.0070.00417.97
8.2.70.0060.00317.90
8.2.60.0040.00418.28
8.2.50.0050.00318.10
8.2.40.0070.00020.55
8.2.30.0040.00419.28
8.2.20.0050.00318.14
8.2.10.0080.00018.12
8.2.00.0050.00317.73
8.1.280.0140.00725.92
8.1.270.0060.00322.14
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0060.00322.19
8.1.230.0080.00317.77
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0100.00017.47
8.1.190.0000.00917.35
8.1.180.0070.00018.10
8.1.170.0000.00818.59
8.1.160.0040.00418.99
8.1.150.0000.00920.28
8.1.140.0030.00519.50
8.1.130.0040.00417.77
8.1.120.0000.00717.41
8.1.110.0040.00417.36
8.1.100.0040.00417.39
8.1.90.0070.00017.44
8.1.80.0040.00417.42
8.1.70.0030.00317.45
8.1.60.0040.00417.52
8.1.50.0060.00317.47
8.1.40.0040.00417.45
8.1.30.0070.00017.66
8.1.20.0050.00217.57
8.1.10.0040.00417.54
8.1.00.0030.00717.34
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00518.40
8.0.270.0070.00017.27
8.0.260.0030.00317.31
8.0.250.0040.00416.87
8.0.240.0030.00316.96
8.0.230.0000.00716.86
8.0.220.0040.00416.77
8.0.210.0070.00016.89
8.0.200.0040.00416.93
8.0.190.0060.00316.96
8.0.180.0030.00416.86
8.0.170.0040.00416.81
8.0.160.0030.00316.80
8.0.150.0040.00416.86
8.0.140.0030.00316.77
8.0.130.0030.00313.35
8.0.120.0000.00716.89
8.0.110.0000.00816.88
8.0.100.0000.00716.79
8.0.90.0050.00316.95
8.0.80.0060.01216.87
8.0.70.0000.00816.73
8.0.60.0050.00316.90
8.0.50.0030.00516.90
8.0.30.0120.00417.00
8.0.20.0110.00917.40
8.0.10.0000.00716.96
8.0.00.0130.00616.94
7.4.330.0060.00015.55
7.4.320.0000.00716.47
7.4.300.0000.00616.59
7.4.290.0030.00316.52
7.4.280.0040.00416.57
7.4.270.0070.00016.70
7.4.260.0030.00716.45
7.4.250.0000.00816.44
7.4.240.0000.00816.44
7.4.230.0070.00016.52
7.4.220.0000.00716.64
7.4.210.0090.00616.65
7.4.200.0050.00216.71
7.4.160.0080.00816.56
7.4.150.0130.00417.40
7.4.140.0160.01017.86
7.4.130.0070.01216.59
7.4.120.0080.01316.46
7.4.110.0070.01016.35
7.4.100.0030.01316.57
7.4.90.0110.00616.50
7.4.80.0000.01616.48
7.4.70.0000.01616.57
7.4.60.0060.01116.36
7.4.50.0060.00316.21
7.4.40.0060.01216.62
7.4.30.0100.01016.42
7.4.00.0100.00615.20
7.3.330.0000.00613.29
7.3.320.0000.00513.36
7.3.310.0080.00016.39
7.3.300.0050.00216.41
7.3.290.0100.00816.37
7.3.280.0090.01116.32
7.3.270.0060.01617.40
7.3.260.0100.00716.54
7.3.250.0070.01016.47
7.3.240.0150.00716.52
7.3.230.0090.00916.39
7.3.210.0090.00616.31
7.3.200.0060.01419.39
7.3.190.0080.00816.41
7.3.180.0080.01516.48
7.3.170.0060.01616.57
7.3.160.0070.00916.19
7.2.330.0060.01216.72
7.2.320.0100.01016.73
7.2.310.0070.00516.78
7.2.300.0030.01516.55
7.2.290.0080.00816.52
7.2.60.0080.00817.07
7.1.200.0090.00315.69
7.1.70.0000.00717.13
7.1.60.0040.00717.23
7.1.00.0100.07022.27
7.0.200.0320.00614.88
7.0.130.0070.05722.04
7.0.120.0130.04722.13
7.0.110.0100.05721.93
7.0.100.0130.05022.16
7.0.90.0130.05722.05
7.0.80.0130.04722.11
7.0.70.0030.06322.07
7.0.60.0070.05722.01
7.0.50.0130.06322.08
7.0.40.0100.07022.07
7.0.30.0100.06322.06
7.0.20.0200.05022.02
7.0.10.0130.05022.04
7.0.00.0030.06022.11
5.6.280.0170.05720.79
5.6.270.0070.05720.80
5.6.260.0100.05320.98
5.6.250.0100.05320.84
5.6.240.0100.05721.11
5.6.230.0100.06021.04
5.6.220.0100.05321.08
5.6.210.0100.05320.95
5.6.200.0230.05721.07
5.6.190.0170.05320.84
5.6.180.0130.05020.89
5.6.170.0030.06021.00
5.6.160.0030.06321.07
5.6.150.0100.06020.75
5.6.140.0100.05721.06
5.6.130.0070.05720.75
5.6.120.0100.05720.87
5.6.110.0130.05320.99
5.6.100.0100.05721.02
5.6.90.0200.04320.83
5.6.80.0000.06020.39
5.6.70.0100.07320.21
5.6.60.0100.07320.38
5.6.50.0170.06320.24
5.6.40.0100.05720.17
5.6.30.0170.06020.40
5.6.20.0100.07720.16
5.6.10.0130.06720.36
5.6.00.0170.04720.40

preferences:
70.32 ms | 401 KiB | 5 Q