3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array( 'id' => 1, 'parent_id' => 0, 'title' => 'Parent Page', 'children' => array( array( 'id' => 2, 'parent_id' => 1, 'title' => 'Sub Page', ), array( 'id' => 5, 'parent_id' => 1, 'title' => 'Sub Page 2', 'children' => array( array( 'id' => 7, 'parent_id' => 5, 'title' => 'Sub Page', ), array( 'id' => 8, 'parent_id' => 5, 'title' => 'Sub Page 2', ) ) ) ) ), array( 'id' => 4, 'parent_id' => 0, 'title' => 'Another Parent Page', ) ); function printAll($arr, $parent = []) { if (is_array($arr)) { foreach ($arr as $k => $v) { if (isset($v['id'])) { $parent[] = $v['id']; echo implode('.', $parent) . PHP_EOL; } if (isset($v['children'])) { printAll($v['children'], $parent); } array_pop($parent); } } } printAll($arr);

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.3.130.0090.00018.58
8.3.120.0030.00521.02
8.3.110.0060.00320.94
8.3.100.0000.00916.40
8.3.90.0130.00326.77
8.3.80.0030.00619.36
8.3.70.0150.00316.63
8.3.60.0120.00318.30
8.3.50.0130.00723.59
8.3.40.0150.00618.82
8.3.30.0000.01618.71
8.3.20.0090.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.250.0060.00316.42
8.2.240.0100.01019.00
8.2.230.0030.00622.58
8.2.220.0060.00324.06
8.2.210.0030.00626.77
8.2.200.0030.00818.88
8.2.190.0070.00718.42
8.2.180.0160.00625.92
8.2.170.0070.01119.05
8.2.160.0080.00622.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00826.35
8.2.110.0050.00522.31
8.2.100.0110.00417.66
8.2.90.0000.00917.62
8.2.80.0030.00618.86
8.2.70.0030.00517.75
8.2.60.0050.00317.75
8.2.50.0030.00518.05
8.2.40.0040.00718.13
8.2.30.0000.00818.34
8.2.20.0000.00718.23
8.2.10.0040.00419.33
8.2.00.0050.00219.30
8.1.300.0000.00816.16
8.1.290.0060.00330.84
8.1.280.0000.01425.92
8.1.270.0040.00423.99
8.1.260.0040.00428.09
8.1.250.0090.00028.09
8.1.240.0030.00620.96
8.1.230.0090.00322.63
8.1.220.0040.00418.64
8.1.210.0000.00818.77
8.1.200.0030.00517.23
8.1.190.0090.00017.10
8.1.180.0040.00418.10
8.1.170.0060.00318.66
8.1.160.0000.00718.77
8.1.150.0040.00418.95
8.1.140.0030.00618.88
8.1.130.0000.00717.41
8.1.120.0070.00017.49
8.1.110.0050.00217.36
8.1.100.0040.00417.44
8.1.90.0040.00417.48
8.1.80.0000.00717.44
8.1.70.0030.00317.35
8.1.60.0050.00317.47
8.1.50.0040.00417.58
8.1.40.0040.00417.43
8.1.30.0050.00317.68
8.1.20.0040.00417.57
8.1.10.0000.00917.48
8.1.00.0030.00617.56
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0000.00718.54
8.0.270.0030.00317.88
8.0.260.0030.00316.86
8.0.250.0000.00717.04
8.0.240.0030.00316.92
8.0.230.0000.00716.89
8.0.220.0000.00716.89
8.0.210.0030.00316.87
8.0.200.0070.00016.98
8.0.190.0040.00416.82
8.0.180.0000.00816.93
8.0.170.0030.00716.80
8.0.160.0000.00716.81
8.0.150.0040.00416.84
8.0.140.0000.00716.84
8.0.130.0000.00513.37
8.0.120.0060.00316.85
8.0.110.0070.00016.78
8.0.100.0040.00416.84
8.0.90.0060.00316.93
8.0.80.0070.00916.87
8.0.70.0040.00417.01
8.0.60.0040.00416.84
8.0.50.0080.00016.79
8.0.30.0070.01017.21
8.0.20.0100.01117.02
8.0.10.0030.00616.90
8.0.00.0080.01216.83
7.4.330.0020.00215.55
7.4.320.0000.00616.50
7.4.300.0000.00616.46
7.4.290.0030.00316.52
7.4.280.0030.00616.57
7.4.270.0000.00716.51
7.4.260.0000.00513.21
7.4.250.0000.00716.57
7.4.240.0000.00816.60
7.4.230.0000.00716.49
7.4.220.0020.00516.55
7.4.210.0090.00716.64
7.4.200.0040.00316.61
7.4.130.0100.00716.36
7.4.120.0060.01316.49
7.4.110.0130.00416.47
7.4.100.0140.00716.50
7.4.90.0080.01216.40
7.4.80.0060.01216.45
7.4.70.0070.01116.57
7.4.60.0070.01116.30
7.4.50.0090.00916.18
7.4.40.0120.00616.28
7.4.30.0060.01116.16
7.4.20.0070.01016.43
7.4.10.0140.00716.40
7.4.00.0120.00616.63
7.3.330.0030.00416.33
7.3.320.0000.00613.38
7.3.310.0030.00416.35
7.3.300.0000.00616.34
7.3.290.0060.00816.33
7.3.280.0060.00916.31
7.3.260.0190.00216.47
7.3.230.0100.00716.27
7.3.210.0160.00316.56
7.3.200.0100.00716.59
7.3.190.0070.01016.52
7.3.180.0140.00316.35
7.3.170.0120.00816.52
7.3.160.0030.01616.43
7.3.150.0030.01316.64
7.3.140.0120.00916.42
7.3.130.0070.01016.61
7.3.120.0110.00716.61
7.3.110.0040.01316.51
7.3.100.0060.01016.48
7.3.90.0080.00816.31
7.3.80.0030.01316.29
7.3.70.0100.00716.29
7.3.60.0090.00916.47
7.3.50.0090.01416.24
7.3.40.0070.01116.32
7.3.30.0040.01716.32
7.3.20.0040.01416.29
7.3.10.0070.01016.34
7.3.00.0100.00716.23
7.2.330.0090.00916.64
7.2.320.0100.00716.67
7.2.310.0120.00616.38
7.2.300.0090.00916.64
7.2.290.0160.00316.69
7.2.280.0060.01216.46
7.2.270.0130.00316.40
7.2.260.0150.00316.65
7.2.250.0110.00816.67
7.2.240.0070.01016.58
7.2.230.0130.00416.77
7.2.220.0100.00716.79
7.2.210.0070.01116.57
7.2.200.0070.01116.54
7.2.190.0070.01816.44
7.2.180.0150.00416.50
7.2.170.0120.00616.61
7.2.160.0140.00716.68
7.2.150.0100.01316.57
7.2.140.0190.00316.64
7.2.130.0110.00716.70
7.2.120.0150.00316.65
7.2.110.0060.01216.68
7.2.100.0000.02216.46
7.2.90.0060.01216.51
7.2.80.0070.01116.50
7.2.70.0120.00616.50
7.2.60.0090.01216.48
7.2.50.0120.00616.50
7.2.40.0090.01216.63
7.2.30.0170.00616.67
7.2.20.0190.00316.57
7.2.10.0130.00716.48
7.2.00.0070.01016.38

preferences:
31.17 ms | 403 KiB | 5 Q