3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'Name/First' => 'John', 'Name/Last' => 'Doe', 'Age' => 20, 'Address/Postal/City' => 'New York', 'Address/Postal/Zip' => 10003, 'Address/Billing/City' => 'Los Angeles', 'Phone' => 123456789, 'Foo/Bar/Foo2/Bar2' => 'test', ]; $newarray = []; foreach($array as $path => $value) { $keys = array_filter(explode('/', $path)); $ref = &$newarray; foreach($keys as $level => $key) { $ref = &$ref[$key]; } $ref = $value; } print_r($newarray);

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.20.0120.00719.33
8.5.10.0080.00916.52
8.5.00.0070.00219.80
8.4.170.0120.01024.02
8.4.160.0110.01123.98
8.4.150.0010.00214.05
8.4.140.0130.00817.55
8.4.130.0100.00617.54
8.4.120.0110.00922.12
8.4.110.0110.00918.93
8.4.100.0160.00417.72
8.4.90.0060.00322.69
8.4.80.0090.01019.37
8.4.70.0040.00417.96
8.4.60.0110.01018.66
8.4.50.0110.01217.46
8.4.40.0070.00317.73
8.4.30.0040.00420.36
8.4.20.0060.00317.80
8.4.10.0070.01319.24
8.3.300.0120.01119.23
8.3.290.0080.01120.32
8.3.280.0170.00718.38
8.3.270.0090.01016.37
8.3.260.0090.01016.45
8.3.250.0110.00819.02
8.3.240.0120.01016.65
8.3.230.0090.01016.57
8.3.220.0080.00820.66
8.3.210.0110.00818.65
8.3.200.0030.00516.66
8.3.190.0100.00817.42
8.3.180.0090.00916.72
8.3.170.0110.00916.63
8.3.160.0170.00316.73
8.3.150.0170.00317.15
8.3.140.0040.01117.13
8.3.130.0160.00318.29
8.3.120.0040.00818.89
8.3.110.0040.00416.59
8.3.100.0060.00624.06
8.3.90.0080.00026.77
8.3.80.0080.00016.70
8.3.70.0160.00616.63
8.3.60.0170.00418.68
8.3.50.0120.00319.73
8.3.40.0100.01018.71
8.3.30.0150.00018.67
8.3.20.0000.00924.18
8.3.10.0050.00324.66
8.3.00.0080.00326.16
8.2.300.0100.01118.15
8.2.290.0080.00920.36
8.2.280.0060.00318.55
8.2.270.0160.00317.26
8.2.260.0000.01416.36
8.2.250.0140.00716.82
8.2.240.0090.00618.66
8.2.230.0120.00320.94
8.2.220.0040.00437.54
8.2.210.0050.00226.77
8.2.200.0060.00316.38
8.2.190.0150.00016.63
8.2.180.0070.01125.92
8.2.170.0070.01418.94
8.2.160.0030.01222.96
8.2.150.0050.00325.66
8.2.140.0100.00724.66
8.2.130.0080.00026.16
8.2.120.0030.00626.16
8.2.110.0070.00322.08
8.2.100.0070.00320.53
8.1.340.0080.00917.23
8.1.330.0110.00721.77
8.1.320.0100.00916.16
8.1.310.0040.01415.99
8.1.300.0080.00019.96
8.1.290.0030.00730.84
8.1.280.0060.00925.92
8.1.270.0050.00322.10
8.1.260.0130.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00418.96
8.1.230.0000.01018.61
7.4.260.0080.00416.45

preferences:
28.58 ms | 403 KiB | 5 Q