3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "world": { "france": { "city": { "city_1": { "name": "paris", "titre": "lorem ipsum" }, "city_2": { "name": "marseille", "titre": "dolor sit amet" } } }, "usa": { "city": { "city_1": { "name": "new york", "titre": "lorem ipsum" }, "city_2": { "name": "los angeles", "titre": "lorem ipsum" }, "city_3": { "name": "portland", "titre": "lorem ipsum" } } } } }'; $data = json_decode($json, true); $options = []; foreach ($data['world'] as $country => ['city' => $cities]) { $options[] = sprintf( '<option data-city="%s">%s</option>', implode(',', array_column($cities, 'name')), $country ); } echo implode("\n", $options);

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.0090.01018.95
8.4.120.0090.01024.05
8.4.110.0100.01117.92
8.4.100.0090.00918.55
8.4.90.0080.00417.77
8.4.80.0070.00317.76
8.4.70.0040.00617.84
8.4.60.0040.00520.40
8.4.50.0110.00917.72
8.4.40.0210.00023.80
8.4.30.0060.01320.34
8.4.20.0130.00717.87
8.4.10.0080.00022.05
8.3.260.0140.00516.75
8.3.250.0080.01118.95
8.3.240.0100.00817.18
8.3.230.0120.00816.80
8.3.220.0090.00617.38
8.3.210.0050.00216.46
8.3.200.0030.00616.69
8.3.190.0110.00819.19
8.3.180.0120.00816.62
8.3.170.0120.00616.54
8.3.160.0040.01416.71
8.3.150.0070.01017.07
8.3.140.0120.00618.81
8.3.130.0090.00018.43
8.3.120.0040.00419.08
8.3.110.0100.00020.94
8.3.100.0040.01124.06
8.3.90.0150.00026.77
8.3.80.0090.00016.50
8.3.70.0100.00716.58
8.3.60.0040.01116.50
8.3.50.0140.00720.30
8.3.40.0040.01121.88
8.3.30.0090.00618.70
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0100.00920.51
8.2.280.0110.00820.08
8.2.270.0140.00416.86
8.2.260.0100.00716.55
8.2.250.0080.00018.59
8.2.240.0040.00417.21
8.2.230.0060.00322.58
8.2.220.0090.00037.54
8.2.210.0150.00026.77
8.2.200.0090.00016.63
8.2.190.0090.00616.63
8.2.180.0060.00925.92
8.2.170.0040.01118.90
8.2.160.0070.00722.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0040.00818.94
8.2.110.0110.00020.39
8.2.100.0110.00017.91
8.2.90.0060.00319.39
8.2.80.0000.00917.97
8.2.70.0030.00617.75
8.2.60.0000.00818.16
8.2.50.0040.00418.07
8.2.40.0000.00820.07
8.2.30.0050.00218.04
8.2.20.0040.00420.37
8.2.10.0030.00618.04
8.2.00.0050.00219.28
8.1.330.0120.00822.08
8.1.320.0130.00716.43
8.1.310.0070.01016.61
8.1.300.0060.00320.31
8.1.290.0030.00630.84
8.1.280.0110.00325.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00622.14
8.1.230.0110.00317.64
8.1.220.0050.00517.79
8.1.210.0040.00418.77
8.1.200.0000.01017.22
8.1.190.0000.00817.23
8.1.180.0030.00618.10
8.1.170.0060.00318.59
8.1.160.0000.00718.86
8.1.150.0040.00418.65
8.1.140.0080.00017.34
8.1.130.0030.00318.97
8.1.120.0030.00517.49
8.1.110.0040.00417.36
8.1.100.0080.00017.51
8.1.90.0070.00017.37
8.1.80.0060.00317.47
8.1.70.0050.00517.44
8.1.60.0000.00917.56
8.1.50.0070.00717.30
8.1.40.0000.01117.02
8.1.30.0130.00016.79
8.1.20.0180.00017.21
8.1.10.0070.00717.12
8.1.00.0150.00016.75
8.0.300.0000.00818.77
8.0.290.0070.00016.63
8.0.280.0000.00720.23
8.0.270.0030.00316.83
8.0.260.0030.00318.34
8.0.250.0030.00316.98
8.0.240.0000.00716.98
8.0.230.0030.00316.96
8.0.220.0070.00016.84
8.0.210.0140.00016.59
8.0.200.0000.01116.27
8.0.190.0000.01416.62
8.0.180.0090.00416.28
8.0.170.0100.00316.53
8.0.160.0040.01116.38
8.0.150.0030.00916.51
8.0.140.0100.00316.62
8.0.130.0090.00516.64
8.0.120.0060.00616.60
8.0.110.0090.00316.47
8.0.100.0100.00315.98
8.0.90.0060.00616.51
8.0.80.0100.00316.20
8.0.70.0030.01016.81
8.0.60.0100.00016.45
8.0.50.0150.00016.53
8.0.30.0070.00716.45
8.0.20.0140.00016.43
8.0.10.0090.00416.60
7.4.330.0020.00215.55
7.4.320.0070.00016.44
7.4.300.0050.00816.35
7.4.290.0110.00516.20
7.4.280.0040.00716.37
7.4.270.0100.00616.21
7.4.260.0040.00915.74
7.4.250.0080.00516.28
7.4.240.0160.00016.10
7.4.230.0030.01115.91
7.4.220.0110.00316.18
7.4.210.0070.00216.32
7.4.200.0050.00616.12
7.4.190.0060.00616.38
7.4.180.0090.00516.11
7.4.160.0050.00715.89
7.4.150.0100.00316.22
7.4.140.0110.00416.24
7.4.130.0000.00816.40
7.4.120.0100.00016.17
7.4.110.0060.00615.91
7.4.100.0030.00616.39
7.4.90.0050.00515.61
7.4.80.0000.00916.08
7.4.70.0100.00015.86
7.4.60.0110.00416.29
7.4.50.0120.00016.04
7.4.40.0130.00015.93
7.4.30.0150.00015.87
7.4.20.0130.00015.92
7.4.10.0140.00015.93
7.4.00.0150.00016.14

preferences:
102.49 ms | 403 KiB | 5 Q