3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lists = array(array( array( 'id' => 1, 'parent' => 0, 'name' => 'Menu 1', ), array( 'id' => 2, 'parent' => 1, 'name' => 'Menu 2', ), array( 'id' => 3, 'parent' => 2, 'name' => 'Menu 3', ), array( 'id' => 4, 'parent' => 1, 'name' => 'Menu 4', ), array( 'id' => 5, 'parent' => 0, 'name' => 'Menu 5', ) )); function make_list($lists, $parent = 0) { $children = array_filter($lists[0], function ($v) use($parent) { return $v['parent'] == $parent; }); if (!count($children)) return; echo "<ul>\n"; foreach ($children as $child) { echo "<li>{$child['name']}</li>\n"; make_list($lists, $child['id']); } echo "</ul>\n"; } make_list($lists);

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.40.0120.00618.98
8.3.30.0070.00718.88
8.3.20.0000.00720.60
8.3.10.0050.00320.48
8.3.00.0040.00421.02
8.2.170.0130.00722.96
8.2.160.0070.00720.79
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0050.00318.03
8.2.120.0080.00026.35
8.2.110.0040.00719.22
8.2.100.0060.00617.91
8.2.90.0040.00419.28
8.2.80.0050.00319.48
8.2.70.0090.00017.63
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0030.00518.04
8.2.30.0050.00518.05
8.2.20.0070.00018.15
8.2.10.0000.00719.51
8.2.00.0000.00818.21
8.1.270.0040.00423.84
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0030.00621.04
8.1.230.0030.00720.95
8.1.220.0040.00417.79
8.1.210.0040.00419.04
8.1.200.0040.00417.23
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0080.00018.53
8.1.160.0070.00018.90
8.1.150.0040.00418.80
8.1.140.0000.00720.26
8.1.130.0000.00717.51
8.1.120.0000.00817.47
8.1.110.0000.01417.47
8.1.100.0000.00817.35
8.1.90.0070.00017.48
8.1.80.0000.00717.50
8.1.70.0000.00717.52
8.1.60.0090.00017.58
8.1.50.0040.00417.51
8.1.40.0040.00417.49
8.1.30.0030.00517.55
8.1.20.0000.00817.64
8.1.10.0030.00617.59
8.1.00.0000.00717.41
8.0.300.0080.00019.99
8.0.290.0030.00616.75
8.0.280.0040.00418.36
8.0.270.0070.00016.74
8.0.260.0000.00616.87
8.0.250.0060.00316.82
8.0.240.0000.00716.92
8.0.230.0000.00716.90
8.0.220.0040.00416.89
8.0.210.0000.00716.82
8.0.200.0040.00417.01
8.0.190.0000.00716.87
8.0.180.0000.00816.90
8.0.170.0000.00916.90
8.0.160.0030.00616.95
8.0.150.0000.00716.84
8.0.140.0000.00716.83
8.0.130.0070.00515.09
8.0.120.0090.00416.85
8.0.110.0020.01116.90
8.0.100.0100.00416.78
8.0.90.0100.00316.81
8.0.80.0110.00616.79
8.0.70.0110.00316.88
8.0.60.0080.00516.86
8.0.50.0090.00516.89
8.0.30.0090.00816.94
8.0.20.0110.00817.04
8.0.10.0090.00416.86
8.0.00.0090.00916.93
7.4.330.0020.00215.55
7.4.320.0000.00716.46
7.4.300.0000.00616.51
7.4.290.0030.00316.36
7.4.280.0000.00816.51
7.4.270.0050.00216.51
7.4.260.0110.00316.52
7.4.250.0090.00516.56
7.4.240.0080.00616.44
7.4.230.0140.00016.36
7.4.220.0070.00616.51
7.4.210.0110.00516.50
7.4.200.0050.00716.40
7.4.190.0190.00016.50
7.4.180.0190.00016.48
7.4.160.0100.00916.50
7.4.150.0130.00416.45
7.4.140.0100.01017.13
7.4.130.0160.00316.54
7.4.120.0140.00516.46
7.4.110.0130.00616.45
7.4.100.0140.00516.36
7.4.90.0150.00616.40
7.4.80.0170.00517.85
7.4.70.0130.00516.50
7.4.60.0140.00516.48
7.4.50.0060.01116.43
7.4.40.0130.00616.34
7.4.30.0070.01516.52
7.4.20.0140.00716.45
7.4.10.0160.00616.55
7.4.00.0080.01016.04
7.3.330.0060.00714.82
7.3.320.0080.00514.84
7.3.310.0070.00716.36
7.3.300.0100.00316.35
7.3.290.0080.00516.36
7.3.280.0060.01216.33
7.3.270.0150.00516.20
7.3.260.0120.00716.43
7.3.250.0160.00416.09
7.3.240.0110.00716.55
7.3.230.0100.01016.53
7.3.220.0110.00016.25
7.3.210.0100.00316.31
7.3.200.0120.00216.40
7.3.190.0090.00816.30
7.3.180.0090.00416.38
7.3.170.0060.01016.22
7.3.160.0120.00616.07
7.3.150.0150.00516.09
7.3.140.0100.00716.33
7.3.130.0110.01016.35
7.3.120.0120.00615.73
7.3.110.0100.00615.72
7.3.100.0110.00615.79
7.3.90.0100.00415.77
7.3.80.0110.00515.78
7.3.70.0120.00515.72
7.3.60.0100.00715.74
7.3.50.0090.00715.70
7.3.40.0100.00715.78
7.3.30.0090.00815.86
7.3.20.0710.00616.20
7.3.10.0430.00416.46
7.3.00.0480.00716.38
7.2.340.0110.00716.19
7.2.330.0130.00516.58
7.2.320.0130.00416.61
7.2.310.0140.00316.48
7.2.300.0140.00416.43
7.2.290.0190.00116.50
7.2.280.0130.00716.36
7.2.270.0140.00816.48
7.2.260.0160.00616.47
7.2.250.0190.00316.62
7.2.240.0100.00716.09
7.2.230.0100.01016.02
7.2.220.0120.00815.97
7.2.210.0110.00815.97
7.2.200.0140.00516.01
7.2.190.0070.01116.00
7.2.180.0120.00616.03
7.2.170.0160.00716.06
7.2.160.0120.00916.11
7.2.150.0510.00716.63
7.2.140.0460.00616.75
7.2.130.0420.00616.83
7.2.120.0730.00516.65
7.2.110.0630.00716.77
7.2.100.0450.00816.76
7.2.90.0450.00516.80
7.2.80.0370.00816.70
7.2.70.0400.00416.79
7.2.60.0460.00416.81
7.2.50.0360.00816.75
7.2.40.0510.00816.79
7.2.30.0430.00916.80
7.2.20.0390.00916.78
7.2.10.0370.00816.76
7.2.00.0320.00916.80
7.1.330.0100.00916.80
7.1.320.0070.01216.84
7.1.310.0130.00716.94
7.1.300.0160.00316.86
7.1.290.0090.00816.77
7.1.280.0110.00816.85
7.1.270.0150.00516.24
7.1.260.0120.00916.20
7.1.250.0470.00515.65
7.1.240.0170.00516.24
7.1.230.0090.01016.31
7.1.220.0130.00816.40
7.1.210.0110.00816.39
7.1.200.0170.00516.36
7.1.190.0110.00916.39
7.1.180.0140.00616.38
7.1.170.0180.00216.32
7.1.160.0140.00616.39
7.1.150.0210.00516.43
7.1.140.0170.00816.32
7.1.130.0200.00616.44
7.1.120.0200.00516.47
7.1.110.0170.00816.39
7.1.100.0100.01216.45
7.1.90.0130.00716.33
7.1.80.0140.01016.31
7.1.70.0140.00816.33
7.1.60.0160.00716.46
7.1.50.0170.00516.33
7.1.40.0150.00816.56
7.1.30.0190.00416.54
7.1.20.0190.00416.33
7.1.10.0170.00616.51
7.1.00.0180.00516.40

preferences:
59.49 ms | 400 KiB | 5 Q