3v4l.org

run code in 500+ PHP versions simultaneously
<?php $comments = [ [1, 1, 'Comment 1'], [2, 1, 'Comment 2'], [3, 2, 'Comment 3'], [4, 1, 'Comment 4'], [5, 2, 'Comment 5'], [6, 3, 'Comment 6'], [7, 7, 'Comment 7'], ]; $map = []; foreach($comments as $c) { $id = $c[0] === $c[1] ? 0 : $c[1]; $map[$id][] = $c; } function print_comments($arr, $depth) { global $map; foreach($arr as $c) { echo str_repeat("--", $depth) . "{$c[2]}\n"; print_comments($map[$c[0]] ?? [], $depth+1); } } print_comments($map[0], 0);

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.5.70.0080.00817.03
8.5.60.0100.00916.90
8.5.50.0090.00718.31
8.5.30.0080.00921.17
8.5.20.0100.00819.94
8.5.10.0110.00720.26
8.5.00.0080.01419.99
8.4.220.0070.00823.98
8.4.210.0080.01019.62
8.4.180.0090.01223.83
8.4.170.0160.00721.79
8.4.160.0160.00925.79
8.4.150.0040.00416.68
8.4.140.0150.01317.79
8.4.130.0130.00618.69
8.4.120.0040.00424.22
8.4.110.0140.00718.94
8.4.100.0110.00918.71
8.4.90.0140.00620.71
8.4.80.0150.00518.75
8.4.70.0040.00419.63
8.4.60.0130.00818.58
8.4.50.0090.00818.66
8.4.40.0040.00423.84
8.4.30.0000.01718.73
8.4.20.0110.01119.48
8.4.10.0060.00324.03
8.3.310.0110.00818.44
8.3.300.0080.01122.73
8.3.290.0100.01118.48
8.3.280.0140.00618.45
8.3.270.0110.00916.63
8.3.260.0130.00616.66
8.3.250.0110.00818.95
8.3.240.0080.01219.05
8.3.230.0050.00416.70
8.3.220.0070.01218.87
8.3.210.0120.00816.69
8.3.200.0050.00416.57
8.3.190.0040.00418.91
8.3.180.0110.00817.07
8.3.170.0120.00619.11
8.3.160.0040.01518.50
8.3.150.0060.01017.15
8.3.140.0110.00716.59
8.3.130.0030.00618.36
8.3.120.0080.00020.65
8.3.110.0030.00620.94
8.3.100.0090.00024.06
8.3.90.0070.01126.77
8.3.80.0040.00417.97
8.3.70.0180.00316.50
8.3.60.0110.00718.43
8.3.50.0070.01116.60
8.3.40.0030.01023.65
8.3.30.0070.00718.81
8.3.20.0040.00424.18
8.3.10.0000.00724.66
8.3.00.0090.00026.16
8.2.310.0140.00718.13
8.2.300.0100.00918.19
8.2.290.0080.00820.27
8.2.280.0100.01018.30
8.2.270.0140.00317.06
8.2.260.0040.00416.63
8.2.250.0110.00316.54
8.2.240.0060.00317.13
8.2.230.0060.00322.58
8.2.220.0040.00737.54
8.2.210.0060.00326.77
8.2.200.0030.00616.50
8.2.190.0110.00316.58
8.2.180.0140.00418.02
8.2.170.0090.00618.85
8.2.160.0070.00722.96
8.2.150.0050.00225.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00421.07
8.2.110.0060.00322.07
8.2.100.0060.00617.84
8.2.90.0040.00417.73
8.2.80.0060.00318.86
8.2.70.0040.00417.63
8.2.60.0000.00817.63
8.2.50.0030.00517.63
8.2.40.0030.00619.23
8.2.30.0090.00517.64
8.2.20.0050.00317.83
8.2.10.0110.00317.75
8.2.00.0100.00517.76
8.1.340.0110.01017.66
8.1.330.0140.00521.98
8.1.320.0050.00418.07
8.1.310.0070.01117.74
8.1.300.0030.00720.19
8.1.290.0000.00930.84
8.1.280.0000.01525.92
8.1.270.0140.00024.66
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0000.01020.83
8.1.230.0040.00820.96
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0040.00417.35
8.1.190.0030.00517.35
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0010.00717.46
8.1.150.0080.00517.49
8.1.140.0090.00617.46
8.1.130.0130.00117.49
8.1.120.0130.00417.41
8.1.110.0130.00217.51
8.1.100.0080.00517.43
8.1.90.0090.00717.52
8.1.80.0140.00217.47
8.1.70.0070.00817.40
8.1.60.0150.00217.58
8.1.50.0080.00717.65
8.1.40.0070.01017.61
8.1.30.0140.00417.63
8.1.20.0110.00317.59
8.1.10.0080.00917.54
8.1.00.0080.00717.53
8.0.300.0050.00320.09
8.0.290.0000.00716.75
8.0.280.0090.00516.87
8.0.270.0110.00116.79
8.0.260.0080.00516.77
8.0.250.0090.00516.73
8.0.240.0070.00416.84
8.0.230.0080.00616.83
8.0.220.0080.00616.80
8.0.210.0090.00716.86
8.0.200.0130.00116.87
8.0.190.0130.00316.90
8.0.180.0140.00316.82
8.0.170.0140.00316.85
8.0.160.0100.00616.90
8.0.150.0100.00516.80
8.0.140.0070.00716.81
8.0.130.0140.00316.73
8.0.120.0090.00716.77
8.0.110.0140.00116.74
8.0.100.0110.00416.65
8.0.90.0100.00516.82
8.0.80.0100.00416.74
8.0.70.0050.00816.74
8.0.60.0130.00216.76
8.0.50.0100.00516.74
8.0.30.0120.00216.79
8.0.20.0080.00616.85
8.0.10.0060.00516.89

preferences:
93.39 ms | 1139 KiB | 5 Q