3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['level_id' => 1, 'level' => 'Trivial', 'description' => 'Foobar'], ['level_id' => 2, 'level' => 'Moderate', 'description' => 'Foobar'], ['level_id' => 3, 'level' => 'Challenging', 'description' => 'Foobar'], ['level_id' => 4, 'level' => 'Formidable'], ]; function toLookup(array $array): array { foreach ($array as $row) { $result[array_shift($row)] = count($row) === 1 ? current($row) : $row; } return $result ?? []; } var_export(toLookup($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.4.130.0110.00818.71
8.4.120.0130.00624.30
8.4.110.0120.00918.79
8.4.100.0110.00917.70
8.4.90.0110.00917.77
8.4.80.0100.01017.91
8.4.70.0050.00419.71
8.4.60.0130.00718.80
8.4.50.0100.00718.70
8.4.40.0070.01319.38
8.4.30.0200.00018.76
8.4.20.0070.01422.54
8.4.10.0000.00924.04
8.3.260.0100.01016.37
8.3.250.0050.00318.95
8.3.240.0160.00616.82
8.3.230.0100.00916.57
8.3.220.0110.00817.28
8.3.210.0080.01116.57
8.3.200.0040.00716.54
8.3.190.0100.01016.63
8.3.180.0050.00420.71
8.3.170.0060.01318.88
8.3.160.0000.00818.37
8.3.150.0130.00616.38
8.3.140.0090.00919.13
8.3.130.0040.00418.48
8.3.120.0060.00320.59
8.3.110.0170.00320.94
8.3.100.0070.00316.63
8.3.90.0000.00826.77
8.3.80.0040.00417.97
8.3.70.0100.00718.57
8.3.60.0080.00818.56
8.3.50.0120.00616.64
8.3.40.0160.00320.34
8.3.30.0060.01018.70
8.3.20.0040.00424.18
8.3.10.0040.00724.66
8.3.00.0080.00026.16
8.2.290.0100.00620.36
8.2.280.0040.00418.36
8.2.270.0080.00020.62
8.2.260.0000.00919.11
8.2.250.0030.00518.36
8.2.240.0130.00317.11
8.2.230.0180.00322.58
8.2.220.0000.00937.54
8.2.210.0160.00326.77
8.2.200.0000.00818.16
8.2.190.0120.00316.60
8.2.180.0040.01116.32
8.2.170.0070.01422.96
8.2.160.0070.01322.96
8.2.150.0090.00025.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0000.00819.31
8.2.100.0090.00317.84
8.2.90.0030.00518.22
8.2.80.0000.00917.97
8.2.70.0000.00917.80
8.2.60.0000.00719.35
8.2.50.0050.00318.10
8.2.40.0000.00720.40
8.2.30.0040.00418.22
8.2.20.0000.00819.36
8.2.10.0060.00620.78
8.2.00.0000.01220.59
8.1.330.0140.00521.84
8.1.320.0130.00716.27
8.1.310.0150.00416.85
8.1.300.0030.00616.25
8.1.290.0050.00530.84
8.1.280.0140.00025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0110.00020.86
8.1.230.0070.00420.84
8.1.220.0000.00817.77
8.1.210.0050.00318.97
8.1.200.0090.00017.13
8.1.190.0040.00417.36
8.1.180.0030.00518.10
8.1.170.0070.00418.44
8.1.160.0040.00418.80
8.1.150.0030.00618.55
8.1.140.0090.00418.74
8.1.130.0080.00618.55
8.1.120.0070.00418.70
8.1.110.0060.00618.69
8.1.100.0160.00418.66
8.1.90.0080.00818.58
8.1.80.0120.00618.61
8.1.70.0050.01118.72
8.1.60.0180.00018.78
8.1.50.0120.00718.62
8.1.40.0180.00018.86
8.1.30.0110.00018.75
8.1.20.0050.00818.75
8.1.10.0070.00518.77
8.1.00.0080.00518.62
8.0.300.0040.00420.04
8.0.290.0080.00016.63
8.0.280.0040.00418.45
8.0.270.0110.00417.95
8.0.260.0050.00918.04
8.0.250.0080.00417.98
8.0.240.0080.00317.98
8.0.230.0140.00317.94
8.0.220.0050.00917.84
8.0.210.0180.00217.96
8.0.200.0060.00317.94
8.0.190.0080.00319.78
8.0.180.0030.00819.70
8.0.170.0090.00319.84
8.0.160.0080.00319.79
8.0.150.0070.00317.97
8.0.140.0030.01117.83
8.0.130.0140.00017.93
8.0.120.0050.01018.01
8.0.110.0120.00317.87
8.0.100.0110.00417.87
8.0.90.0160.00017.95
8.0.80.0100.00517.89
8.0.70.0160.00017.96
8.0.60.0150.00017.95
8.0.50.0140.00017.81
8.0.30.0130.00017.96
8.0.20.0070.01017.96
8.0.10.0090.00418.15

preferences:
32.79 ms | 403 KiB | 5 Q