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"); 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.70.0110.01118.46
8.3.60.0070.00716.75
8.3.50.0130.00721.99
8.3.40.0060.00918.84
8.3.30.0100.00618.79
8.3.20.0080.00019.14
8.3.10.0040.00423.52
8.3.00.0070.00019.02
8.2.190.0080.00616.58
8.2.180.0100.00716.75
8.2.170.0140.00718.91
8.2.160.0100.00322.96
8.2.150.0120.00624.18
8.2.140.0000.00824.66
8.2.130.0090.00926.16
8.2.120.0050.00321.13
8.2.110.0030.00619.21
8.2.100.0080.00417.72
8.2.90.0050.00320.47
8.2.80.0050.00320.50
8.2.70.0040.00418.04
8.2.60.0000.00718.21
8.2.50.0030.00618.10
8.2.40.0000.00720.55
8.2.30.0040.00419.20
8.2.20.0070.00018.11
8.2.10.0040.00418.05
8.2.00.0070.00017.76
8.1.280.0070.00725.92
8.1.270.0090.00622.14
8.1.260.0140.00426.35
8.1.250.0100.00328.09
8.1.240.0060.00323.82
8.1.230.0040.00820.90
8.1.220.0040.00417.79
8.1.210.0080.00019.04
8.1.200.0000.00917.35
8.1.190.0040.00416.99
8.1.180.0050.00318.10
8.1.170.0000.00818.59
8.1.160.0050.00219.09
8.1.150.0030.00620.24
8.1.140.0040.00419.50
8.1.130.0030.00517.64
8.1.120.0070.00017.50
8.1.110.0070.00017.37
8.1.100.0030.00517.53
8.1.90.0040.00417.40
8.1.80.0030.00317.36
8.1.70.0000.00717.44
8.1.60.0000.00817.43
8.1.50.0040.00417.57
8.1.40.0070.00017.42
8.1.30.0000.00817.68
8.1.20.0040.00417.66
8.1.10.0000.00717.57
8.1.00.0060.00317.44
8.0.300.0080.00019.94
8.0.290.0080.00016.63
8.0.280.0040.00418.41
8.0.270.0000.00817.24
8.0.260.0000.00817.15
8.0.250.0070.00017.04
8.0.240.0030.00316.86
8.0.230.0030.00516.84
8.0.220.0090.00016.79
8.0.210.0000.00716.84
8.0.200.0000.00616.99
8.0.190.0040.00416.98
8.0.180.0050.00216.89
8.0.170.0000.00716.97
8.0.160.0040.00416.83
8.0.150.0030.00316.84
8.0.140.0030.00516.93
8.0.130.0070.00013.32
8.0.120.0070.00016.92
8.0.110.0080.00016.79
8.0.100.0040.00416.89
8.0.90.0050.00316.78
8.0.80.0100.01016.88
8.0.70.0070.00016.82
8.0.60.0000.00716.97
8.0.50.0040.00416.89
8.0.30.0170.00317.22
8.0.20.0080.01017.40
8.0.10.0070.00016.96
8.0.00.0060.01516.63
7.4.330.0000.00615.55
7.4.320.0030.00316.54
7.4.300.0050.00216.60
7.4.290.0000.00816.50
7.4.280.0030.00516.52
7.4.270.0070.00016.62
7.4.260.0080.00016.59
7.4.250.0040.00416.48
7.4.240.0030.00316.54
7.4.230.0070.00016.50
7.4.220.0120.00616.50
7.4.210.0030.01516.48
7.4.200.0050.00216.42
7.4.160.0100.00516.40
7.4.150.0150.00617.40
7.4.140.0100.00917.86
7.4.130.0110.00916.57
7.4.120.0090.00916.51
7.4.110.0130.00416.65
7.4.100.0100.00716.61
7.4.90.0140.00316.71
7.4.80.0090.00916.42
7.4.70.0130.00316.43
7.4.60.0100.00616.53
7.4.50.0080.00316.57
7.4.40.0090.00916.40
7.4.30.0090.00616.39
7.4.00.0070.01115.16
7.3.330.0020.00213.23
7.3.320.0020.00213.32
7.3.310.0080.00016.39
7.3.300.0000.00716.22
7.3.290.0060.00816.38
7.3.280.0090.01016.38
7.3.270.0080.00817.40
7.3.260.0050.01516.36
7.3.250.0090.00716.31
7.3.240.0120.01116.38
7.3.230.0090.00916.41
7.3.210.0080.00816.32
7.3.200.0090.00919.39
7.3.190.0060.00916.42
7.3.180.0150.00016.38
7.3.170.0100.00716.61
7.3.160.0030.01416.47
7.2.330.0110.00716.59
7.2.320.0140.00616.68
7.2.310.0130.01016.79
7.2.300.0060.01116.63
7.2.290.0090.00616.72
7.2.120.0100.00316.59
7.2.110.0030.01016.75
7.2.100.0030.01016.67
7.2.90.0030.00616.70
7.2.80.0060.00616.66
7.2.70.0060.00817.14
7.2.60.0020.01116.84
7.2.50.0090.00616.93
7.2.40.0100.00316.96
7.2.30.0110.00317.06
7.2.20.0070.00716.90
7.2.10.0090.00616.99
7.2.00.0120.00616.99
7.1.240.0030.00615.98
7.1.230.0030.00915.77
7.1.220.0030.01015.86
7.1.210.0030.01015.61
7.1.200.0080.00815.64
7.1.190.0000.01315.46
7.1.180.0000.01315.79
7.1.170.0030.00715.64
7.1.160.0070.00715.88
7.1.150.0040.00815.84
7.1.140.0000.00815.40
7.1.130.0040.00815.71
7.1.120.0060.00915.76
7.1.110.0030.00515.68
7.1.100.0070.00315.73
7.1.90.0100.00315.68
7.1.80.0060.01015.87
7.1.70.0070.00516.40
7.1.60.0020.01016.60
7.1.50.0070.00715.99
7.1.40.0070.00315.67
7.1.30.0030.00915.50
7.1.20.0070.00715.61
7.1.10.0090.00315.61
7.1.00.0080.03819.04
7.0.320.0000.01315.42
7.0.310.0030.01015.53
7.0.300.0030.00615.12
7.0.290.0030.01015.31
7.0.280.0090.00015.34
7.0.270.0000.01415.48
7.0.260.0000.01315.05
7.0.250.0120.00315.34
7.0.240.0000.01515.36
7.0.230.0090.00015.33
7.0.220.0060.00915.33
7.0.210.0040.01115.26
7.0.200.0180.00815.08
7.0.190.0100.00315.48
7.0.180.0030.01215.39
7.0.170.0070.00715.47
7.0.160.0090.00615.39
7.0.150.0060.00615.30
7.0.140.0060.00615.24
7.0.130.0070.02918.79
7.0.120.0050.03018.71
7.0.110.0070.03218.78
7.0.100.0060.03018.74
7.0.90.0080.02818.71
7.0.80.0040.03418.82
7.0.70.0030.03318.73
7.0.60.0070.03018.72
7.0.50.0050.03818.72
7.0.40.0080.02817.77
7.0.30.0070.03017.77
7.0.20.0110.02617.82
7.0.10.0050.03117.90
7.0.00.0050.03917.73
5.6.380.0060.00614.45
5.6.370.0100.00314.24
5.6.360.0060.00314.48
5.6.350.0070.00414.55
5.6.340.0040.01114.37
5.6.330.0000.01214.30
5.6.320.0070.00713.97
5.6.310.0070.00714.36
5.6.300.0030.00914.54
5.6.290.0000.01114.53
5.6.280.0030.03217.65
5.6.270.0070.03317.57
5.6.260.0070.02817.67
5.6.250.0150.02517.70
5.6.240.0070.03217.54
5.6.230.0070.03217.64
5.6.220.0050.03117.67
5.6.210.0050.03217.57
5.6.200.0100.02817.78
5.6.190.0080.03017.50
5.6.180.0080.03017.57
5.6.170.0050.03217.59
5.6.160.0080.03317.78
5.6.150.0020.03517.61
5.6.140.0040.03417.55
5.6.130.0050.03317.67
5.6.120.0040.03517.69
5.6.110.0070.03417.79
5.6.100.0030.03617.76
5.6.90.0040.03117.56
5.6.80.0060.02817.27
5.6.70.0080.03317.44
5.6.60.0050.03317.40
5.6.50.0000.03217.44
5.6.40.0020.03217.36
5.6.30.0110.02417.31
5.6.20.0080.02717.37
5.6.10.0030.03117.35
5.6.00.0120.03517.24

preferences:
48.01 ms | 401 KiB | 5 Q