3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "data": [ { "sentenceArray": [ { "path": { "type": "walk", "nodes": [ { "lat": 39.952614, "lng": 32.854491 }, { "lat": 39.952083, "lng": 32.857761 } ] } }, { "path": { "type": "bus", "nodes": [ { "lat": 39.952418, "lng": 32.85727 }, { "lat": 39.952797, "lng": 32.856825 }, { "lat": 39.953102, "lng": 32.856438 } ] } }, { "path": { "type": "bus", "nodes": [ { "lat": 39.964951, "lng": 32.841305 }, { "lat": 39.964785, "lng": 32.841514 } ] } } ] }, { "sentenceArray": [ { "path": { "type": "walk", "nodes": [ { "lat": 39.952614, "lng": 32.854491 }, { "lat": 39.952083, "lng": 32.857761 } ] } }, { "path": { "type": "bus", "nodes": [ { "lat": 39.952418, "lng": 32.85727 }, { "lat": 39.952797, "lng": 32.856825 }, { "lat": 39.953102, "lng": 32.856438 } ] } }, { "path": { "type": "bus", "nodes": [ { "lat": 39.964951, "lng": 32.841305 }, { "lat": 39.964785, "lng": 32.841514 } ] } } ] } ] }'; $array = json_decode($json, true); foreach ($array['data'] as $datas) { foreach ($datas['sentenceArray'] as $subitem) { if ($subitem['path']['type'] == 'bus' && isset($subitem['path']['nodes'])) { $result[] = $subitem['path']['nodes']; } } } echo json_encode($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.4.130.0100.01017.88
8.4.120.0100.01020.39
8.4.110.0110.00918.89
8.4.100.0070.00818.83
8.4.90.0030.00718.70
8.4.80.0120.00818.67
8.4.70.0080.00617.82
8.4.60.0100.01118.87
8.4.50.0080.01220.61
8.4.40.0130.00717.55
8.4.30.0160.00317.59
8.4.20.0120.00917.74
8.4.10.0060.00320.61
8.3.250.0040.00418.98
8.3.240.0110.01116.66
8.3.230.0110.00719.16
8.3.220.0100.00719.03
8.3.210.0150.00318.38
8.3.200.0070.00216.45
8.3.190.0080.01017.06
8.3.180.0130.00516.62
8.3.170.0120.00617.14
8.3.160.0040.01019.15
8.3.150.0140.00418.95
8.3.140.0150.00317.20
8.3.130.0000.00818.53
8.3.120.0060.01320.80
8.3.110.0030.00618.61
8.3.100.0100.00324.06
8.3.90.0130.00326.77
8.3.80.0070.00317.97
8.3.70.0150.00016.58
8.3.60.0100.00718.43
8.3.50.0100.00318.22
8.3.40.0110.00418.79
8.3.30.0160.00618.73
8.3.20.0000.00819.11
8.3.10.0040.00421.91
8.3.00.0040.00422.50
8.2.290.0110.00920.66
8.2.280.0050.00318.61
8.2.270.0040.00417.05
8.2.260.0130.00616.45
8.2.250.0070.01118.48
8.2.240.0040.00418.94
8.2.230.0060.00320.94
8.2.220.0090.00037.54
8.2.210.0120.00326.77
8.2.200.0060.00316.75
8.2.190.0070.00716.75
8.2.180.0090.00618.43
8.2.170.0120.00322.96
8.2.160.0030.01020.37
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0080.00019.66
8.2.110.0030.00720.39
8.2.100.0090.00319.57
8.2.90.0080.00318.33
8.2.80.0040.00418.05
8.2.70.0080.00017.91
8.2.60.0080.00018.16
8.2.50.0030.00518.10
8.2.40.0000.00919.17
8.2.30.0070.00019.41
8.2.20.0000.00718.05
8.2.10.0000.00718.05
8.2.00.0000.00719.16
8.1.330.0130.00622.14
8.1.320.0120.00716.04
8.1.310.0040.00418.56
8.1.300.0060.00318.56
8.1.290.0130.00330.84
8.1.280.0090.00625.92
8.1.270.0030.00624.02
8.1.260.0200.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00323.83
8.1.230.0080.00320.88
8.1.220.0040.00417.76
8.1.210.0000.01018.77
8.1.200.0030.00617.35
8.1.190.0060.00317.22
8.1.180.0040.00418.10
8.1.170.0000.01018.65
8.1.160.0050.00318.75
8.1.150.0000.00719.00
8.1.140.0040.00417.57
8.1.130.0030.00318.92
8.1.120.0040.00417.51
8.1.110.0040.00417.46
8.1.100.0000.00817.40
8.1.90.0040.00417.35
8.1.80.0030.00317.36
8.1.70.0040.00717.31
8.1.60.0040.00417.56
8.1.50.0000.00817.51
8.1.40.0000.00717.57
8.1.30.0040.00417.48
8.1.20.0060.00317.69
8.1.10.0020.00517.50
8.1.00.0050.00317.49
8.0.300.0000.00819.84
8.0.290.0000.00816.75
8.0.280.0030.00318.44
8.0.270.0040.00417.30
8.0.260.0070.00017.26
8.0.250.0000.00716.91
8.0.240.0000.00716.84
8.0.230.0100.00016.84
8.0.220.0040.00416.75
8.0.210.0030.00316.88
8.0.200.0000.00616.93
8.0.190.0030.00616.80
8.0.180.0000.00716.76
8.0.170.0040.00416.92
8.0.160.0030.00616.98
8.0.150.0000.00816.82
8.0.140.0000.00716.75
8.0.130.0050.00013.35
8.0.120.0000.00816.83
8.0.110.0040.00416.73
8.0.100.0000.00716.75
8.0.90.0070.00016.95
8.0.80.0120.00916.87
8.0.70.0040.00416.99
8.0.60.0000.00816.98
8.0.50.0000.00816.70
8.0.30.0090.00817.16
8.0.20.0130.00717.40
8.0.10.0040.00417.04
8.0.00.0050.01416.93
7.4.330.0060.00016.82
7.4.320.0040.00416.50
7.4.300.0070.00016.61
7.4.290.0000.00716.58
7.4.280.0030.00516.47
7.4.270.0030.00316.64
7.4.260.0030.00316.55
7.4.250.0000.00716.53
7.4.240.0000.00716.58
7.4.230.0030.00316.33
7.4.220.0080.00016.60
7.4.210.0110.00816.61
7.4.200.0000.00716.24
7.4.160.0100.00716.49
7.4.140.0120.00717.86
7.4.130.0100.01416.35
7.4.120.0100.00916.45
7.4.110.0130.00316.49
7.4.100.0040.01516.43
7.4.90.0120.01216.54
7.4.80.0120.00919.39
7.4.70.0090.00916.46
7.4.60.0070.01016.53
7.4.50.0040.01516.41
7.4.40.0030.01416.43
7.4.00.0130.00314.95
7.3.330.0000.00513.17
7.3.320.0000.00613.23
7.3.310.0030.00316.41
7.3.300.0030.00316.34
7.3.290.0030.00416.27
7.3.280.0100.01016.33
7.3.260.0100.00916.45
7.3.240.0080.01016.41
7.3.230.0080.00816.64
7.3.210.0100.00516.41
7.3.200.0080.00816.26
7.3.190.0130.00916.58
7.3.180.0090.00616.54
7.3.170.0110.01116.28
7.3.160.0060.01016.30
7.2.330.0170.00016.44
7.2.320.0080.01016.77
7.2.310.0120.01116.77
7.2.300.0100.00616.57
7.2.290.0090.01516.77
7.2.80.0100.00716.93
7.2.60.0040.01116.92
7.2.40.7210.01017.97
7.2.30.2790.00817.70
7.2.20.3580.01117.88
7.2.10.3270.01717.70
7.2.00.3230.01117.60
7.1.200.0060.00615.88
7.1.160.4770.00916.55
7.1.150.2980.00616.69
7.1.140.3570.01116.50
7.1.130.4610.01416.66
7.1.120.2810.00916.59
7.1.110.2760.00615.73
7.1.100.3450.01115.81
7.1.90.3340.00815.59
7.1.80.3560.00915.84
7.1.70.3030.00515.38
7.1.60.4110.01233.35
7.1.50.5680.00732.92
7.1.40.5360.00932.51
7.1.30.0780.01832.46
7.1.20.3920.01432.45
7.1.10.0490.01114.50
7.1.00.5100.01114.72

preferences:
33.52 ms | 403 KiB | 5 Q