3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'Группа' => array( 'Ид' => 'aed92e32-a88d-11e9-b74b-002522d5a8f5', 'Наименование' => '01_ДЛЯ ПРОДАЖ', 'Группы' => array( 'Группа' => array( '10' => array( 'Ид' => '776ea23c-4a7a-11ea-a3ba-002522d5a8f5', 'Наименование' => 'Литература', 'Группы' => array( 'Группа' => array( 'Ид' => 'faa0a831-4b3a-11ea-a3ba-002522d5a8f5', 'Наименование' => 'Журналы учета', ), ), ), ) )) ); function list_items($array, $parent = 0) { $output = array(); if (isset($array['Ид'])) { $array = array($array); } foreach ($array as $arr) { if (!is_array($arr)) echo $arr; $output[] = array('id' => $arr['Ид'], 'name' => $arr['Наименование'], 'parent' => $parent); if (is_array($arr['Группы']['Группа'] ?? NULL)) { $output = array_merge($output, list_items($arr['Группы']['Группа'], $arr['Ид'])); } } return $output; } $items = list_items($array); print_r($items);

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.10.0090.00019.55
8.3.140.0040.00416.43
8.3.130.0000.00818.27
8.3.120.0040.00418.92
8.3.110.0000.00820.94
8.3.100.0070.00418.34
8.3.90.0080.00016.91
8.3.80.0030.00617.97
8.3.70.0200.00316.59
8.3.60.0120.00318.31
8.3.50.0100.01124.59
8.3.40.0180.00418.82
8.3.30.0090.00918.68
8.3.20.0000.00721.91
8.3.10.0040.00422.10
8.3.00.0000.00821.82
8.2.260.0030.00916.66
8.2.250.0110.00716.43
8.2.240.0030.00618.74
8.2.230.0090.00022.58
8.2.220.0090.00024.06
8.2.210.0050.00326.77
8.2.200.0070.00416.50
8.2.190.0080.00816.75
8.2.180.0070.00718.29
8.2.170.0070.01122.96
8.2.160.0110.00722.11
8.2.150.0150.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00420.74
8.2.110.0060.00319.38
8.2.100.0060.00617.91
8.2.90.0040.00419.14
8.2.80.0000.01217.97
8.2.70.0060.00317.63
8.2.60.0000.00918.05
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0070.00318.28
8.2.20.0030.00618.17
8.2.10.0040.00419.36
8.2.00.0000.00819.42
8.1.310.0140.00319.91
8.1.300.0120.00315.96
8.1.290.0000.00918.88
8.1.280.0140.00425.92
8.1.270.0080.00022.04
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0050.00522.74
8.1.230.0030.00717.77
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0100.00017.11
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0110.00018.50
8.1.160.0040.00418.98
8.1.150.0040.00418.93
8.1.140.0030.00518.95
8.1.130.0030.00317.53
8.1.120.0000.00817.46
8.1.110.0040.00417.46
8.1.100.0000.00717.40
8.1.90.0040.00417.41
8.1.80.0040.00417.44
8.1.70.0030.00317.51
8.1.60.0040.00417.53
8.1.50.0040.00417.59
8.1.40.0000.00817.59
8.1.30.0040.00417.70
8.1.20.0030.00617.57
8.1.10.0040.00417.51
8.1.00.0000.00817.45
8.0.300.0020.00518.77
8.0.290.0070.00016.88
8.0.280.0000.00818.50
8.0.270.0000.00717.99
8.0.260.0030.00316.78
8.0.250.0040.00416.98
8.0.240.0030.00317.04
8.0.230.0000.00717.05
8.0.220.0000.00716.93
8.0.210.0070.00016.98
8.0.200.0020.00517.02
8.0.190.0000.00716.97
8.0.180.0040.00416.92
8.0.170.0030.00616.99
8.0.160.0030.00416.85
8.0.150.0050.00216.82
8.0.140.0000.00716.82
8.0.130.0000.00613.40
8.0.120.0040.00416.86
8.0.110.0050.00316.93
8.0.100.0070.00016.83
8.0.90.0000.00916.93
8.0.80.0030.01516.87
8.0.70.0050.00217.00
8.0.60.0040.00416.82
8.0.50.0040.00417.00
8.0.30.0100.00717.29
8.0.20.0110.00716.87
8.0.10.0000.01017.10
8.0.00.0060.01116.95
7.4.330.0040.00015.55
7.4.320.0030.00316.50
7.4.300.0030.00316.57
7.4.290.0000.00816.60
7.4.280.0040.00416.54
7.4.270.0030.00316.47
7.4.260.0040.00416.63
7.4.250.0030.00316.50
7.4.240.0030.00616.70
7.4.230.0000.00716.62
7.4.220.0030.00316.65
7.4.210.0090.00716.62
7.4.200.0000.00716.67
7.4.130.0130.00716.48
7.4.120.0030.01616.57
7.4.110.0100.00716.44
7.4.100.0110.00716.61
7.4.90.0040.01516.40
7.4.80.0090.00919.39
7.4.70.0070.01016.36
7.4.60.0060.01016.71
7.4.50.0070.01216.38
7.4.40.0100.01016.34
7.4.30.0120.00616.46
7.4.20.0070.01016.04
7.4.10.0100.00716.28
7.4.00.0130.01016.52
7.3.330.0030.00316.20
7.3.320.0030.00313.47
7.3.310.0070.00016.38
7.3.300.0030.00316.36
7.3.290.0120.00416.41
7.3.260.0060.01416.46
7.3.240.0130.00416.47
7.3.230.0120.00616.41
7.3.210.0090.01316.64
7.3.200.0060.01616.40
7.3.190.0060.01016.48
7.3.180.0160.00316.58
7.3.170.0150.00716.30
7.3.160.0030.01516.43
7.3.150.0100.00716.44
7.3.140.0170.00716.70
7.3.130.0100.00716.59
7.3.120.0090.01316.32
7.3.110.0070.01016.23
7.3.100.0130.00316.23
7.3.90.0150.00316.48
7.3.80.0120.00616.36
7.3.70.0120.00816.53
7.3.60.0130.00316.31
7.3.50.0120.00716.41
7.3.40.0040.01416.30
7.3.30.0140.00316.29
7.3.20.0150.00616.45
7.3.10.0130.00716.30
7.3.00.0070.01016.43
7.2.330.0090.00916.82
7.2.320.0130.00616.74
7.2.310.0030.01316.36
7.2.300.0030.01616.77
7.2.290.0110.00616.57
7.2.280.0030.01516.69
7.2.270.0100.01416.75
7.2.260.0090.00916.65
7.2.250.0000.02116.40
7.2.240.0090.00816.43
7.2.230.0090.01516.66
7.2.220.0100.01016.53
7.2.210.0070.01016.55
7.2.200.0100.01016.49
7.2.190.0070.01016.64
7.2.180.0060.01216.65
7.2.170.0070.01016.64
7.2.160.0110.00716.59
7.2.150.0040.01316.80
7.2.140.0090.00916.67
7.2.130.0070.01116.66
7.2.120.0100.00916.70
7.2.110.0110.00916.59
7.2.100.0160.00616.69
7.2.90.0060.01416.75
7.2.80.0100.01416.78
7.2.70.0090.01216.46
7.2.60.0090.01216.73
7.2.50.0100.00716.75
7.2.40.0140.00316.64
7.2.30.0040.01316.67
7.2.20.0090.00916.61
7.2.10.0090.00916.75
7.2.00.0080.01216.69

preferences:
29.46 ms | 403 KiB | 5 Q