3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '2017-05-01' => [ 'DC' => [ 'IT' => [90, 0], 'DE' => [18, 315, 40, '', 69, 211], 'Other' => [107, 46, '', '', 27, 22] ] ], '2017-05-02' => [ 'DC' => [ 'IT' => [70, 40, 55], 'DE' => ['', 31, 4, '', 9], 'Other' => [1107, 12, 0, 20, 1, 11, 21] ] ], 'fringe case' => [ 'DC' => [ 'IT' => [], 'DE' => ['', '', '', 99], 'Other' => ['', 99] ] ] ]; array_walk( $array, fn(&$dateSet) => array_walk( $dateSet, fn(&$dcSet) => array_walk( $dcSet, function (&$set) { if (!$set) { $set = 0; return; } sort($set); $count = count($set); $mid = intdiv($count, 2); if ($count & 1) { $set = $set[$mid]; return; } $set = ((int)$set[$mid - 1] + (int)$set[$mid]) / 2; } ) ) ); var_export($array);

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.0140.00819.95
8.4.150.0020.00114.05
8.4.140.0140.00717.55
8.4.130.0100.00718.57
8.4.120.0050.00423.91
8.4.110.0130.00717.95
8.4.100.0160.00418.80
8.4.90.0110.01018.70
8.4.80.0050.00419.46
8.4.70.0160.00517.84
8.4.60.0050.00618.85
8.4.50.0080.00618.86
8.4.40.0060.00617.71
8.4.30.0370.01417.44
8.4.20.0480.00317.56
8.4.10.0350.01217.52
8.3.280.0120.00918.66
8.3.270.0060.01416.86
8.3.260.0130.00616.45
8.3.250.0090.01118.73
8.3.240.0080.01017.19
8.3.230.0100.00816.72
8.3.220.0080.01017.09
8.3.210.0100.00716.57
8.3.200.0030.00616.52
8.3.190.0090.01017.17
8.3.180.0120.00616.48
8.3.170.0140.00417.05
8.3.160.0340.01516.33
8.3.150.0340.01016.52
8.3.140.0340.01116.35
8.3.130.0120.00916.37
8.3.120.0280.00616.53
8.3.110.0240.00316.64
8.3.100.0430.00916.44
8.3.90.0360.01116.35
8.3.80.0430.00616.73
8.3.70.0270.01116.46
8.3.60.0320.00016.63
8.3.50.0210.01116.11
8.3.40.0340.00017.46
8.3.30.0360.00617.51
8.3.20.0310.00717.47
8.3.10.0280.01017.44
8.3.00.0150.00917.48
8.2.290.0160.00420.67
8.2.280.0080.00716.76
8.2.270.0340.00616.38
8.2.260.0270.01216.22
8.2.250.0320.00616.58
8.2.240.0270.01316.58
8.2.230.0420.01016.16
8.2.220.0260.00716.84
8.2.210.0160.00716.61
8.2.200.0330.00016.87
8.2.190.0300.00616.42
8.2.180.0320.00916.32
8.2.170.0380.01417.39
8.2.160.0320.00917.65
8.2.150.0320.00317.45
8.2.140.0390.00617.30
8.2.130.0300.00717.49
8.2.120.0220.00617.39
8.2.110.0220.00417.21
8.2.100.0350.00017.47
8.2.90.0310.00717.40
8.2.80.0270.01417.29
8.2.70.0340.01017.21
8.2.60.0350.00617.21
8.2.50.0370.00817.33
8.2.40.0210.00517.25
8.2.30.0150.00317.47
8.2.20.0230.00017.30
8.2.10.0200.00817.27
8.2.00.0090.00917.59
8.1.320.0160.00417.82

preferences:
48.53 ms | 403 KiB | 5 Q