3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Helper { public static function populateCustomMatrices (array $data, array $conf): array { $result = []; foreach ($conf as $groupName => $inclusions) { $isolatedData = array_intersect_key($data, array_flip($inclusions)); for ($i = 0, $max = max(array_map('count', $isolatedData)); $i < $max; ++$i) { foreach ($inclusions as $key) { $result[$groupName][$i][$key] = $isolatedData[$key][$i] ?? 0; } } } return $result; } } $data = [ 'assets' => [1, 2, 3], 'liabilities' => [1, 2, 3, 4, 5, 6], 'equity' => [1], 'income' => [1, 2, 3, 4], 'expenses' => [1, 2, 3] ]; $conf = [ 'balance_sheet' => ['assets', 'liabilities', 'equity'], 'income' => ['income', 'expenses'], ]; var_export(Helper::populateCustomMatrices($data, $conf));

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.10.0110.00816.58
8.5.00.0100.01120.04
8.4.150.0020.00014.05
8.4.140.0120.00917.49
8.4.130.0120.00417.81
8.4.120.0140.00524.28
8.4.110.0120.00822.43
8.4.100.0110.01017.99
8.4.90.0030.00618.79
8.4.80.0120.00819.40
8.4.70.0130.00817.72
8.4.60.0090.01218.86
8.4.50.0130.00817.71
8.4.40.0030.01617.68
8.4.30.0160.00318.52
8.4.20.0140.00717.93
8.4.10.0070.01021.06
8.3.280.0130.00718.32
8.3.270.0100.01016.74
8.3.260.0130.00716.60
8.3.250.0070.00718.92
8.3.240.0110.00917.11
8.3.230.0040.00616.60
8.3.220.0120.00517.20
8.3.210.0120.00316.78
8.3.200.0050.00416.62
8.3.190.0090.00116.66
8.3.180.0110.00716.78
8.3.170.0110.00716.70
8.3.160.0030.00617.50
8.3.150.0160.00318.95
8.3.140.0000.00817.43
8.3.130.0060.00318.29
8.3.120.0090.00019.02
8.3.110.0080.00020.94
8.3.100.0050.00524.06
8.3.90.0080.00826.77
8.3.80.0030.00616.63
8.3.70.0100.01016.58
8.3.60.0140.00718.43
8.3.50.0140.00824.37
8.3.40.0110.01121.88
8.3.30.0110.00418.70
8.3.20.0070.00724.18
8.3.10.0070.00024.66
8.3.00.0030.00626.16
8.2.290.0140.00620.45
8.2.280.0050.00418.50
8.2.270.0060.01216.61
8.2.260.0090.00016.93
8.2.250.0080.00016.95
8.2.240.0130.00617.40
8.2.230.0030.00622.58
8.2.220.0160.00337.54
8.2.210.0070.01126.77
8.2.200.0030.00616.63
8.2.190.0110.00416.58
8.2.180.0170.00325.92
8.2.170.0170.00318.94
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0090.00624.66
8.2.130.0080.00026.16
8.2.120.0050.00319.63
8.2.110.0000.01122.11
8.2.100.0090.00317.91
8.2.90.0060.00318.34
8.2.80.0000.00819.04
8.2.70.0100.00017.75
8.2.60.0080.00017.75
8.2.50.0040.00418.05
8.2.40.0030.00618.28
8.2.30.0040.00418.17
8.2.20.0060.00318.27
8.2.10.0000.00719.39
8.2.00.0040.00419.27
8.1.330.0100.01023.66
8.1.320.0130.00616.04
8.1.310.0050.00318.56
8.1.300.0000.00919.55
8.1.290.0060.00318.88
8.1.280.0070.00725.92
8.1.270.0040.00422.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.61
8.1.230.0060.00620.99
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0000.00817.35
8.1.190.0090.00017.35
8.1.180.0080.00018.10
8.1.170.0040.00418.51
8.1.160.0040.00418.85
8.1.150.0040.00418.86
8.1.140.0000.00718.82
8.1.130.0040.00417.49
8.1.120.0040.00417.50
8.1.110.0000.00817.35
8.1.100.0070.00017.35
8.1.90.0040.00417.52
8.1.80.0080.00017.48
8.1.70.0060.00317.52
8.1.60.0030.00517.63
8.1.50.0040.00417.52
8.1.40.0000.00817.54
8.1.30.0030.00517.73
8.1.20.0000.00917.56
8.1.10.0080.00017.48
8.1.00.0000.00817.47
8.0.300.0000.00820.29
8.0.290.0000.00816.88
8.0.280.0000.00918.42
8.0.270.0030.00318.10
8.0.260.0030.00616.89
8.0.250.0040.00416.89
8.0.240.0050.00216.97
8.0.230.0080.00016.96
8.0.220.0000.00716.93
8.0.210.0000.00616.94
8.0.200.0050.00217.03
8.0.190.0000.00816.98
8.0.180.0040.00416.92
8.0.170.0060.00316.95
8.0.160.0070.00017.00
8.0.150.0030.00316.92
8.0.140.0070.00016.80
8.0.130.0030.00313.33
8.0.120.0080.00016.91
8.0.110.0000.00816.96
8.0.100.0000.00717.00
8.0.90.0070.00016.75
8.0.80.0050.01316.86
8.0.70.0000.00816.97
8.0.60.0040.00416.78
8.0.50.0050.00216.92
8.0.30.0060.01117.34
8.0.20.0120.00917.03
8.0.10.0000.00816.87
8.0.00.0170.00316.58
7.4.330.0000.00515.55
7.4.320.0000.00616.63
7.4.300.0080.00016.66
7.4.290.0000.00716.55
7.4.280.0030.00516.54
7.4.270.0000.00816.61
7.4.260.0050.00013.31
7.4.250.0000.00816.59
7.4.240.0060.00316.56
7.4.230.0000.00716.39
7.4.220.0020.00516.45
7.4.210.0060.01116.66
7.4.200.0050.00216.64
7.4.130.0200.00316.46
7.4.120.0080.02016.61
7.4.110.0120.01316.54
7.4.100.0060.01216.60
7.4.90.0070.01316.38
7.4.80.0120.01216.79
7.4.70.0150.00316.65
7.4.60.0060.01316.67
7.4.50.0200.00316.40
7.4.40.0070.01716.70
7.4.30.0080.01216.62
7.4.20.0090.00916.41
7.4.10.0160.00416.25
7.4.00.0120.00916.54
7.3.330.0000.00716.20
7.3.320.0020.00213.30
7.3.310.0040.00416.30
7.3.300.0030.00616.40
7.3.290.0080.00816.38
7.3.260.0130.00616.49
7.3.250.0210.00016.56
7.3.240.0140.01016.44
7.3.230.0180.00616.37
7.3.220.0080.01716.39
7.3.210.0030.01416.30
7.3.200.0130.01016.70
7.3.190.0090.00916.27
7.3.180.0160.00616.55
7.3.170.0210.00316.38
7.3.160.0120.01216.50
7.3.150.0100.01016.45
7.3.140.0030.01616.56
7.3.130.0080.01616.43
7.3.120.0160.01016.35
7.3.110.0130.00616.28
7.3.100.0130.01016.63
7.3.90.0170.00916.45
7.3.80.0160.00716.59
7.3.70.0170.00616.53
7.3.60.0190.00616.33
7.3.50.0100.01416.38
7.3.40.0120.01216.52
7.3.30.0070.01416.57
7.3.20.0150.00616.36
7.3.10.0190.00316.41
7.3.00.0150.01016.55

preferences:
36.08 ms | 403 KiB | 5 Q