3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 2 => 'first=1', 3 => 'second=2', 4 => 'third=', 5 => 'first=4', 9 => 'second=3', ]; $result = []; foreach ($array as $string) { [$key, $value] = explode('=', $string, 2); if (!isset($entry) || isset($entry[$key])) { unset($entry); $result[] = &$entry; } $entry[$key] = $value; } var_export($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.0070.01118.43
8.3.50.0100.00716.54
8.3.40.0140.00021.86
8.3.30.0150.00318.79
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.180.0130.01025.92
8.2.170.0100.00722.96
8.2.160.0090.00622.96
8.2.150.0070.00025.66
8.2.140.0000.00724.66
8.2.130.0050.00326.16
8.2.120.0040.00418.89
8.2.110.0110.00020.95
8.2.100.0080.00417.59
8.2.90.0040.00419.17
8.2.80.0080.00017.97
8.2.70.0100.00017.61
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0080.00019.89
8.2.30.0000.00818.03
8.2.20.0070.00018.00
8.2.10.0040.00419.21
8.2.00.0000.00719.22
8.1.280.0070.01325.92
8.1.270.0040.00422.20
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0060.00320.88
8.1.230.0120.00017.66
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0000.00818.29
8.1.160.0070.00018.93
8.1.150.0000.00718.89
8.1.140.0000.00718.92
8.1.130.0000.00720.13
8.1.120.0030.00517.36
8.1.110.0040.00417.43
8.1.100.0040.00417.28
8.1.90.0070.00017.39
8.1.80.0030.00617.47
8.1.70.0040.00417.35
8.1.60.0040.00417.61
8.1.50.0060.00317.35
8.1.40.0080.00017.40
8.1.30.0030.00617.58
8.1.20.0040.00417.47
8.1.10.0080.00417.44
8.1.00.0070.00317.55
8.0.300.0040.00419.83
8.0.290.0060.00316.63
8.0.280.0000.00718.31
8.0.270.0040.00418.06
8.0.260.0060.00018.63
8.0.250.0030.00316.92
8.0.240.0080.00016.95
8.0.230.0000.00816.97
8.0.220.0050.00316.94
8.0.210.0040.00416.92
8.0.200.0000.00717.00
8.0.190.0060.00316.81
8.0.180.0030.00316.79
8.0.170.0050.00316.79
8.0.160.0000.00716.89
8.0.150.0000.00716.84
8.0.140.0030.00616.87
8.0.130.0060.00013.28
8.0.120.0030.00516.72
8.0.110.0000.00716.82
8.0.100.0070.00016.90
8.0.90.0040.00416.90
8.0.80.0100.00416.84
8.0.70.0000.00717.00
8.0.60.0070.00016.91
8.0.50.0000.00716.76
8.0.30.0130.00317.05
8.0.20.0150.00417.16
8.0.10.0060.00316.96
8.0.00.0070.01116.64
7.4.330.0000.00515.55
7.4.320.0000.00616.60
7.4.300.0030.00316.53
7.4.290.0050.00216.32
7.4.280.0030.00516.50
7.4.270.0030.00316.45
7.4.260.0000.00513.25
7.4.250.0040.00416.45
7.4.240.0000.00816.55
7.4.230.0060.00016.60
7.4.220.0050.00216.65
7.4.210.0060.00916.53
7.4.200.0030.00316.66
7.4.130.0140.01116.48
7.4.120.0040.01616.47
7.4.110.0140.00416.59
7.4.100.0120.01516.46
7.4.90.0130.00616.46
7.4.80.0190.00616.53
7.4.70.0130.01016.42
7.4.60.0170.00716.36
7.4.50.0090.01216.35
7.4.40.0160.00616.37
7.4.30.0110.00816.53
7.4.20.0120.00916.53
7.4.10.0150.00616.38
7.4.00.0120.01816.64
7.3.330.0040.00416.37
7.3.320.0000.00613.16
7.3.310.0050.00316.17
7.3.300.0000.00616.32
7.3.290.0100.00916.34
7.3.260.0090.00916.38
7.3.250.0110.00716.59
7.3.240.0090.01216.23
7.3.230.0100.00816.35
7.3.220.0030.02216.52
7.3.210.0170.00716.64
7.3.200.0090.00916.39
7.3.190.0150.00616.58
7.3.180.0110.00716.46
7.3.170.0130.01316.19
7.3.160.0150.01216.20
7.3.150.0140.01116.51
7.3.140.0150.00916.49
7.3.130.0120.00816.36
7.3.120.0110.01916.34
7.3.110.0130.00716.39
7.3.100.0100.01616.30
7.3.90.0130.00716.30
7.3.80.0120.00616.45
7.3.70.0180.00416.38
7.3.60.0070.01616.41
7.3.50.0140.00616.33
7.3.40.0080.01216.39
7.3.30.0220.00316.37
7.3.20.0140.00818.19
7.3.10.0100.01018.22
7.3.00.0160.00818.09

preferences:
54.14 ms | 400 KiB | 5 Q