3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tasks[] = array(id => 1, parent_id => 0, title => 'task 1'); $tasks[] = array(id => 2, parent_id => 1, title => 'sub task 1'); $tasks[] = array(id => 3, parent_id => 1, title => 'sub task 2'); $tasks[] = array(id => 4, parent_id => 2, title => 'sub sub task 1'); $tasks[] = array(id => 5, parent_id => 0, title => 'task 2'); $tasks[] = array(id => 6, parent_id => 5, title => 'sub task 3'); function treeview($array, $id = 0) { for ($i = 0; $i < count($array); $i++) { if($array[$i][parent_id]==$id) { echo $array[$i][id].' '.$array[$i][parent_id].' '.$array[$i][title].'<br />'; treeview($array, $array[$i]['id']); } } } treeview($tasks);

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.60.0040.01116.75
8.3.50.0140.00721.97
8.3.40.0070.00718.92
8.3.30.0110.00319.13
8.3.20.0060.00320.29
8.3.10.0040.00423.69
8.3.00.0050.00319.05
8.2.180.0060.01217.00
8.2.170.0100.00722.96
8.2.160.0040.01120.57
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00320.76
8.2.110.0030.00622.27
8.2.100.0050.00517.91
8.2.90.0070.00019.05
8.2.80.0030.00617.97
8.2.70.0040.00417.50
8.2.60.0060.00317.93
8.2.50.0000.00818.07
8.2.40.0080.00019.95
8.2.30.0040.00418.36
8.2.20.0000.00717.83
8.2.10.0040.00418.13
8.2.00.0000.00817.71
8.1.280.0120.00625.92
8.1.270.0000.00824.01
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0060.00321.94
8.1.230.0040.00719.08
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0040.00917.35
8.1.190.0040.00417.22
8.1.180.0070.00018.10
8.1.170.0040.00818.45
8.1.160.0040.00422.04
8.1.150.0070.00018.52
8.1.140.0000.00717.34
8.1.130.0030.00317.71
8.1.120.0030.00317.42
8.1.110.0000.00717.32
8.1.100.0040.00417.48
8.1.90.0070.00017.34
8.1.80.0050.00317.33
8.1.70.0040.00417.37
8.1.60.0030.00517.48
8.1.50.0000.00817.46
8.1.40.0020.00517.45
8.1.30.0030.00517.64
8.1.20.0060.00317.53
8.1.10.0020.00517.57
8.1.00.0040.00417.37
8.0.300.0070.00018.77
8.0.290.0050.00317.16
8.0.280.0070.00018.47
8.0.270.0040.00417.28
8.0.260.0030.00317.16
8.0.250.0070.00017.05
8.0.240.0040.00417.06
8.0.230.0030.00317.06
8.0.220.0030.00317.00
8.0.210.0070.00016.97
8.0.200.0000.00617.05
8.0.190.0000.00917.01
8.0.180.0000.00716.90
8.0.170.0000.00817.07
8.0.160.0000.00717.05
8.0.150.0000.00716.97
8.0.140.0000.00716.83
8.0.130.0070.00313.42
8.0.120.0000.00916.97
8.0.110.0040.00416.95
8.0.100.0070.00016.94
8.0.90.0060.00316.88
8.0.80.0090.00616.97
8.0.70.0000.00716.87
8.0.60.0000.00816.86
8.0.50.0050.00216.93
8.0.30.0120.00717.23
8.0.20.0030.01617.40
8.0.10.0030.00516.86
8.0.00.0080.01016.83
7.4.330.0050.00015.00
7.4.320.0000.00616.64
7.4.300.0030.00316.55
7.4.290.0070.00016.50
7.4.280.0000.00716.55
7.4.270.0030.00316.50
7.4.260.0030.00616.64
7.4.250.0000.00816.53
7.4.240.0010.00616.57
7.4.230.0000.00816.74
7.4.220.0120.00616.68
7.4.210.0050.00916.66
7.4.200.0070.00016.71
7.4.190.0000.00716.80
7.4.160.0120.00616.45
7.4.150.0080.01117.40
7.4.140.0070.01117.86
7.4.130.0140.00416.59
7.4.120.0110.00616.47
7.4.110.0100.01016.47
7.4.100.0070.01116.64
7.4.90.0030.01616.41
7.4.80.0070.01019.39
7.4.70.0030.01316.38
7.4.60.0130.01016.54
7.4.50.0040.00016.64
7.4.40.0160.00016.59
7.4.30.0070.01016.77
7.4.00.0070.00915.03
7.3.330.0030.00313.30
7.3.320.0050.00013.49
7.3.310.0050.00216.29
7.3.300.0070.00016.35
7.3.290.0060.01016.47
7.3.280.0100.01016.46
7.3.270.0140.00517.40
7.3.260.0160.00816.52
7.3.250.0120.00816.38
7.3.240.0150.00416.50
7.3.230.0130.00416.50
7.3.210.0060.01316.56
7.3.200.0040.01819.39
7.3.190.0040.01416.43
7.3.180.0180.00716.56
7.3.170.0030.01316.53
7.3.160.0120.01216.43
7.3.120.0070.00915.06
7.3.110.0100.01014.89
7.3.100.0060.01214.96
7.3.90.0100.00314.66
7.3.80.0130.00614.98
7.3.70.0060.00314.96
7.3.60.0090.00614.93
7.3.50.0070.00714.87
7.3.40.0040.01114.97
7.3.30.0060.01114.81
7.3.20.0030.00816.75
7.3.10.0080.00416.47
7.3.00.0070.00316.69
7.2.330.0040.01616.88
7.2.320.0100.01316.75
7.2.310.0110.00616.52
7.2.300.0120.00616.50
7.2.290.0090.01516.86
7.2.250.0110.00415.04
7.2.240.0030.01715.31
7.2.230.0110.00415.31
7.2.220.0070.00714.98
7.2.210.0090.00915.14
7.2.200.0090.00615.08
7.2.190.0100.00715.14
7.2.180.0000.01315.24
7.2.170.0030.00714.96
7.2.60.0000.01716.96
7.2.00.0030.01019.59
7.1.330.0030.01015.73
7.1.320.0030.01015.77
7.1.310.0040.01415.68
7.1.300.0030.00615.96
7.1.290.0080.00615.56
7.1.280.0090.00615.80
7.1.270.0070.00715.79
7.1.260.0040.00815.81
7.1.200.0000.01515.63
7.1.100.0040.01118.43
7.1.70.0110.00017.26
7.1.60.0090.00619.46
7.1.50.0030.01417.02
7.1.00.0000.08022.48
7.0.200.0060.00316.66
7.0.140.0030.07322.05
7.0.60.0030.08019.92
7.0.50.0030.04017.88
7.0.40.0130.08020.23
7.0.30.0400.04720.23
7.0.20.0070.05720.07
7.0.10.0200.03720.30
7.0.00.0030.06720.20
5.6.210.0130.07320.51
5.6.200.0030.04718.25
5.6.190.0070.08720.67
5.6.180.0200.08720.69
5.6.170.0270.07720.46
5.6.160.0000.08720.50
5.6.150.0200.06318.15
5.6.140.0030.08318.28
5.6.130.0170.07718.23
5.6.120.0000.05021.11
5.6.110.0070.07721.02
5.6.100.0070.08321.20
5.6.90.0000.04721.09
5.6.80.0100.07720.49
5.6.70.4070.03720.51
5.5.350.0170.08720.31
5.5.340.0130.05017.95
5.5.330.0100.08720.32
5.5.320.0230.04020.35
5.5.310.0070.06020.27
5.5.300.0000.04017.98
5.5.290.0030.06317.98
5.5.280.0000.08320.75
5.5.270.0100.03720.98
5.5.260.0070.07320.88
5.5.250.0070.03720.63
5.5.240.0170.07720.26
5.4.450.0370.03719.33
5.4.440.1030.04719.57
5.4.430.0500.04719.63
5.4.420.0170.05319.39
5.4.410.0130.06018.81
5.4.400.0400.06318.82
5.4.390.0100.06018.70
5.4.380.0130.05018.84
5.4.370.0270.03018.63
5.4.360.0100.04318.59
5.4.350.0150.04712.02
5.4.340.0070.03912.02
5.4.320.0070.03612.51
5.4.310.0040.04112.50
5.4.300.0100.04212.51
5.4.290.0020.04712.50
5.4.280.0100.03712.40
5.4.270.0040.04112.40
5.4.260.0060.04312.40
5.4.250.0100.04012.41
5.4.240.0170.04212.40
5.4.230.0100.04412.39
5.4.220.0050.05012.39
5.4.210.0110.03912.39
5.4.200.0070.04512.40
5.4.190.0120.03412.39
5.4.180.0060.04012.39
5.4.170.0100.04112.40
5.4.160.0160.03412.39
5.4.150.0050.04312.39
5.4.140.0040.04212.07
5.4.130.0090.03712.07
5.4.120.0090.03612.02
5.4.110.0120.03212.02
5.4.100.0090.03712.02
5.4.90.0080.04412.02
5.4.80.0070.03912.02
5.4.70.0080.03612.01
5.4.60.0060.03912.01
5.4.50.0070.03912.01
5.4.40.0060.03812.00
5.4.30.0040.04812.00
5.4.20.0110.04912.00
5.4.10.0110.05212.00
5.4.00.0110.04111.49
5.3.290.0090.04512.80
5.3.280.0090.04012.71
5.3.270.0080.04312.72
5.3.260.0110.04612.72
5.3.250.0070.04312.72
5.3.240.0070.04012.72
5.3.230.0080.05112.70
5.3.220.0110.05012.68
5.3.210.0120.05912.68
5.3.200.0090.06012.68
5.3.190.0120.04112.68
5.3.180.0110.03712.68
5.3.170.0100.03812.67
5.3.160.0080.04512.67
5.3.150.0080.04212.67
5.3.140.0100.04012.66
5.3.130.0120.05012.66
5.3.120.0120.06412.66
5.3.110.0140.05412.66
5.3.100.0080.05512.12
5.3.90.0150.05012.10
5.3.80.0100.05312.09
5.3.70.0110.05212.09
5.3.60.0090.04412.07
5.3.50.0060.04812.03
5.3.40.0090.04912.02
5.3.30.0100.05311.99
5.3.20.0120.04411.77
5.3.10.0100.04711.73
5.3.00.0140.04811.71
5.2.170.0100.0439.22
5.2.160.0050.0449.22
5.2.150.0030.0439.22
5.2.140.0070.0389.21
5.2.130.0080.0329.18
5.2.120.0060.0329.18
5.2.110.0050.0349.18
5.2.100.0070.0389.18
5.2.90.0050.0369.18
5.2.80.0050.0349.18
5.2.70.0120.0529.18
5.2.60.0060.0429.13
5.2.50.0090.0409.10
5.2.40.0100.0359.08
5.2.30.0090.0389.05
5.2.20.0080.0379.05
5.2.10.0090.0388.96
5.2.00.0070.0438.82
5.1.60.0100.0388.10
5.1.50.0040.0328.09
5.1.40.0070.0318.07
5.1.30.0080.0298.43
5.1.20.0110.0388.45
5.1.10.0090.0318.16
5.1.00.0140.0538.16
5.0.50.0090.0256.65
5.0.40.0080.0326.51
5.0.30.0130.0906.32
5.0.20.0090.0636.29
5.0.10.0060.0486.27
5.0.00.0100.0606.26
4.4.90.0080.0474.78
4.4.80.0060.0334.75
4.4.70.0020.0294.75
4.4.60.0080.0414.76
4.4.50.0040.0234.77
4.4.40.0040.0364.71
4.4.30.0060.0214.76
4.4.20.0050.0234.84
4.4.10.0050.0234.84
4.4.00.0030.0354.76
4.3.110.0030.0244.67
4.3.100.0060.0214.66
4.3.90.0030.0234.64
4.3.80.0040.0344.58
4.3.70.0020.0254.63
4.3.60.0050.0224.63
4.3.50.0060.0224.63
4.3.40.0060.0324.53
4.3.30.0020.0243.32
4.3.20.0040.0223.31
4.3.10.0040.0223.25
4.3.00.0030.01716.13

preferences:
66.31 ms | 400 KiB | 5 Q