3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '2019-09-28' => [ 'A' => 4, 'B' => 85, 'C' => 200, ], '2019-09-29' => [ 'A' => 5, 'B' => 83, 'C' => 202, ] ]; $res = []; foreach ($array as $key => $item) { foreach ($item as $itemKey => $itemValue) { $res[$itemKey][$key] = $itemValue; } } print_r($res);

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.4.120.0100.00922.44
8.4.110.0130.00817.71
8.4.100.0170.00317.79
8.4.90.0040.00420.51
8.4.80.0130.00618.99
8.4.70.0050.00318.75
8.4.60.0110.00620.66
8.4.50.0110.00818.78
8.4.40.0000.00819.25
8.4.30.0100.01018.33
8.4.20.0060.01318.92
8.4.10.0060.00917.83
8.3.250.0090.00720.91
8.3.240.0100.00916.54
8.3.230.0060.00516.71
8.3.220.0040.00418.99
8.3.210.0110.00816.74
8.3.200.0050.00316.73
8.3.190.0100.00918.94
8.3.180.0070.00718.89
8.3.170.0100.00718.88
8.3.160.0140.00418.66
8.3.150.0060.01318.90
8.3.140.0000.00820.80
8.3.130.0100.01018.40
8.3.120.0030.01219.05
8.3.110.0070.00016.71
8.3.100.0110.00716.27
8.3.90.0080.00018.43
8.3.80.0030.00618.43
8.3.70.0090.01218.31
8.3.60.0120.00318.43
8.3.50.0070.00917.44
8.3.40.0120.00318.71
8.3.30.0070.01118.75
8.3.20.0040.00420.52
8.3.10.0050.00322.05
8.3.00.0070.00022.52
8.2.290.0130.00716.85
8.2.280.0140.00820.38
8.2.270.0140.00416.82
8.2.260.0070.00717.53
8.2.250.0100.00016.50
8.2.240.0030.00618.91
8.2.230.0030.00620.94
8.2.220.0120.00324.06
8.2.210.0080.00026.77
8.2.200.0090.00018.41
8.2.190.0070.00716.58
8.2.180.0040.01118.30
8.2.170.0110.00422.96
8.2.160.0120.00320.34
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0000.00726.16
8.2.120.0000.00726.16
8.2.110.0090.00020.84
8.2.100.0040.00817.97
8.2.90.0000.00817.63
8.2.80.0040.00417.97
8.2.70.0040.01018.04
8.2.60.0030.00618.16
8.2.50.0000.00918.10
8.2.40.0060.00319.47
8.2.30.0040.00419.20
8.2.20.0050.00318.05
8.2.10.0030.00319.51
8.2.00.0040.00419.43
8.1.330.0110.00716.32
8.1.320.0130.00517.88
8.1.310.0070.00716.90
8.1.300.0120.00318.00
8.1.290.0090.00018.88
8.1.280.0170.00725.92
8.1.270.0030.00523.88
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0120.00622.57
8.1.230.0110.00020.99
8.1.220.0000.00917.91
8.1.210.0030.00520.84
8.1.200.0060.00317.25
8.1.190.0080.00017.22
8.1.180.0070.00318.10
8.1.170.0040.00418.50
8.1.160.0040.00418.94
8.1.150.0030.00518.82
8.1.140.0070.00022.04
8.1.130.0030.00320.06
8.1.120.0030.00317.48
8.1.110.0070.00017.46
8.1.100.0070.00017.47
8.1.90.0030.00617.50
8.1.80.0040.00417.44
8.1.70.0030.00517.50
8.1.60.0040.00417.60
8.1.50.0040.00417.55
8.1.40.0040.00817.55
8.1.30.0000.00917.56
8.1.20.0040.00417.61
8.1.10.0040.00417.47
8.1.00.0030.00617.52
8.0.300.0040.00419.90
8.0.290.0040.00416.75
8.0.280.0000.00818.45
8.0.270.0030.00316.82
8.0.260.0060.00020.05
8.0.250.0040.00416.85
8.0.240.0040.00416.92
8.0.230.0070.00016.94
8.0.220.0000.00716.89
8.0.210.0070.00016.89
8.0.200.0040.00416.86
8.0.190.0000.00716.86
8.0.180.0070.00416.82
8.0.170.0040.00716.98
8.0.160.0040.00416.90
8.0.150.0030.00516.88
8.0.140.0040.00416.89
8.0.130.0030.00313.37
8.0.120.0040.00416.91
8.0.110.0040.00416.77
8.0.100.0040.00416.85
8.0.90.0090.00016.95
8.0.80.0030.01216.86
8.0.70.0000.00916.79
8.0.60.0040.00416.95
8.0.50.0000.00716.96
8.0.30.0070.01017.00
8.0.20.0140.00817.03
8.0.10.0050.00216.92
8.0.00.0120.00616.77
7.4.330.0030.00315.55
7.4.320.0060.00016.56
7.4.300.0000.00616.60
7.4.290.0040.00416.55
7.4.280.0000.00716.63
7.4.270.0030.00316.43
7.4.260.0030.00313.35
7.4.250.0030.00316.40
7.4.240.0020.00716.54
7.4.230.0040.00416.68
7.4.220.0050.00216.51
7.4.210.0070.01016.61
7.4.200.0030.00316.50
7.4.130.0180.00416.55
7.4.120.0050.01516.54
7.4.110.0060.01016.50
7.4.100.0170.00016.45
7.4.90.0070.01016.35
7.4.80.0060.01719.39
7.4.70.0000.01616.63
7.4.60.0130.00916.62
7.4.50.0040.00716.57
7.4.40.0090.00916.40
7.4.00.0110.00714.65
7.3.330.0040.00416.34
7.3.320.0050.00013.21
7.3.310.0040.00416.32
7.3.300.0030.00316.32
7.3.290.0030.00316.37
7.3.260.0100.00916.51
7.3.240.0100.00816.43
7.3.230.0100.00716.37
7.3.210.0060.01316.62
7.3.200.0070.01516.25
7.3.190.0090.00616.31
7.3.180.0100.01016.65
7.3.170.0120.00316.32
7.3.160.0080.01116.39
7.3.100.0120.01014.39
7.3.90.0080.01314.12
7.3.80.0120.00914.64
7.3.70.0090.00614.79
7.3.60.0130.00614.91
7.3.50.0090.00914.61
7.3.40.0100.00714.39
7.3.30.0160.00614.57
7.3.20.1020.01614.73
7.3.10.0250.01314.71
7.3.00.0400.00314.52
7.2.330.0140.00316.61
7.2.320.0040.01916.50
7.2.310.0100.00616.70
7.2.300.0150.00316.32
7.2.290.0050.01116.45
7.2.220.0090.01714.70
7.2.210.0080.01214.63
7.2.200.0150.00314.98
7.2.190.0100.00814.88
7.2.180.0060.00914.92
7.2.170.0040.01214.87
7.2.160.0090.00914.49
7.2.150.0430.00714.69
7.2.140.0420.00514.84
7.2.130.0830.00715.03
7.2.120.0610.01614.70
7.2.110.0280.01014.80
7.2.100.1010.00914.97
7.2.90.0620.01615.11
7.2.80.0920.00915.02
7.2.70.0750.01315.02
7.2.60.0450.01314.86
7.2.50.1220.00715.04
7.2.40.1220.01315.16
7.2.30.0370.01015.00
7.2.20.0600.00615.05
7.2.10.0690.00715.00
7.2.00.1050.01414.98
7.1.320.0400.00713.79
7.1.310.0200.01013.83
7.1.300.0400.00314.01
7.1.290.0490.00913.80
7.1.280.0740.00914.02
7.1.270.0640.00513.74
7.1.260.0200.00813.55
7.1.250.0490.00713.80

preferences:
29.19 ms | 403 KiB | 5 Q