3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array('id'=>1,'pid'=>'0','name'=>'11111'), array('id'=>2,'pid'=>'1','name'=>'22222'), array('id'=>3,'pid'=>'0','name'=>'33333'), array('id'=>4,'pid'=>'3','name'=>'44444'), array('id'=>5,'pid'=>'4','name'=>'55555'), array('id'=>6,'pid'=>'1','name'=>'66666')); function create_tree($arr,$pid=0) { $ret = array(); foreach($arr as $k => $v) { if($v['pid'] == $pid) { $tmp = $arr[$k];unset($arr[$k]); $tmp['children'] = create_tree($arr,$v['id']); $ret[] = $tmp; } } return $ret; }

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.0000.01518.67
8.3.30.0090.00618.96
8.3.20.0030.00520.04
8.3.10.0040.00423.64
8.3.00.0040.00419.13
8.2.170.0110.00422.96
8.2.160.0100.00320.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.07
8.2.110.0080.00022.16
8.2.100.0120.00017.66
8.2.90.0000.00719.25
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0060.00317.80
8.2.50.0000.00818.07
8.2.40.0060.00319.71
8.2.30.0000.00717.89
8.2.20.0050.00217.51
8.2.10.0080.00018.00
8.2.00.0070.00017.64
8.1.270.0060.00322.13
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.76
8.1.230.0070.00719.19
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0060.00317.10
8.1.180.0100.00018.88
8.1.170.0050.00318.42
8.1.160.0050.00321.81
8.1.150.0000.00718.57
8.1.140.0000.00817.45
8.1.130.0000.00717.75
8.1.120.0040.00417.42
8.1.110.0040.00417.30
8.1.100.0040.00417.39
8.1.90.0070.00017.37
8.1.80.0050.00217.28
8.1.70.0070.00017.42
8.1.60.0040.00417.52
8.1.50.0000.00917.46
8.1.40.0000.00817.45
8.1.30.0050.00317.55
8.1.20.0000.00817.48
8.1.10.0040.00417.42
8.1.00.0090.00017.40
8.0.300.0050.00318.77
8.0.290.0080.00017.16
8.0.280.0030.00318.27
8.0.270.0030.00517.25
8.0.260.0000.00617.27
8.0.250.0000.00816.82
8.0.240.0040.00416.92
8.0.230.0080.00016.76
8.0.220.0070.00016.86
8.0.210.0070.00016.75
8.0.200.0000.00716.91
8.0.190.0030.00716.87
8.0.180.0050.00216.89
8.0.170.0060.00316.82
8.0.160.0000.00816.83
8.0.150.0000.00716.82
8.0.140.0040.00416.87
8.0.130.0030.00313.36
8.0.120.0000.00816.68
8.0.110.0000.00816.76
8.0.100.0000.00716.73
8.0.90.0040.00416.77
8.0.80.0060.01016.80
8.0.70.0080.00016.77
8.0.60.0000.00716.88
8.0.50.0040.00416.73
8.0.30.0080.01216.97
8.0.20.0060.01417.40
8.0.10.0040.00416.84
8.0.00.0090.01216.61
7.4.330.0000.00515.00
7.4.320.0030.00316.51
7.4.300.0060.00016.45
7.4.290.0000.00716.47
7.4.280.0040.00716.46
7.4.270.0050.00316.39
7.4.260.0050.00216.41
7.4.250.0000.00716.50
7.4.240.0040.00416.43
7.4.230.0070.00016.35
7.4.220.0060.01016.57
7.4.210.0070.00716.49
7.4.200.0040.00416.49
7.4.190.0070.00016.50
7.4.160.0130.00316.61
7.4.150.0090.00917.40
7.4.140.0120.01017.86
7.4.130.0110.00616.36
7.4.120.0120.00616.47
7.4.110.0110.00616.48
7.4.100.0150.00416.32
7.4.90.0050.01316.44
7.4.80.0120.00919.39
7.4.70.0100.01416.34
7.4.60.0030.01416.36
7.4.50.0040.00416.50
7.4.40.0060.01016.40
7.4.30.0050.01116.44
7.4.00.0080.00814.61
7.3.330.0060.00013.13
7.3.320.0060.00013.11
7.3.310.0030.00416.12
7.3.300.0030.00316.12
7.3.290.0060.01316.12
7.3.280.0100.00616.16
7.3.270.0080.00817.40
7.3.260.0100.00616.39
7.3.250.0080.01216.18
7.3.240.0060.01016.25
7.3.230.0100.00716.42
7.3.210.0050.01116.15
7.3.200.0110.00719.39
7.3.190.0110.01116.14
7.3.180.0080.01216.20
7.3.170.0030.01216.27
7.3.160.0060.01016.21
7.3.120.0070.01014.55
7.3.10.0090.01316.18
7.3.00.0090.00916.05
7.2.330.0030.01416.50
7.2.320.0100.01016.61
7.2.310.0140.00316.59
7.2.300.0070.01316.18
7.2.290.0090.01216.34
7.2.130.0140.00716.37
7.2.120.0180.01216.65
7.2.110.0100.00716.55
7.2.100.0070.01016.27
7.2.90.0100.01616.01
7.2.80.0180.01016.67
7.2.70.0210.01016.36
7.2.60.0150.00416.74
7.2.50.0200.00716.49
7.2.40.0090.01716.36
7.2.30.0150.00416.57
7.2.20.0080.01616.29
7.2.10.0120.01216.16
7.2.00.0100.00817.94
7.1.250.0140.00715.21
7.1.100.0070.01018.13
7.1.70.0000.00916.96
7.1.60.0040.01119.46
7.1.50.0040.01116.94
7.1.00.0070.07322.41
7.0.200.0040.00416.64
7.0.140.0070.07022.21
7.0.60.0070.08321.72
7.0.50.0030.08022.12
7.0.40.0030.06720.04
7.0.30.0000.05320.19
7.0.20.0070.08020.07
7.0.10.0030.08020.09
7.0.00.0000.05720.00
5.6.280.0000.07720.93
5.6.210.0070.05320.47
5.6.200.0070.08021.00
5.6.190.0170.06021.00
5.6.180.0070.08021.16
5.6.170.0000.04720.99
5.6.160.0000.05321.00
5.6.150.0070.08021.10
5.6.140.0070.08020.94
5.6.130.0070.07020.99
5.6.120.0070.07021.14
5.6.110.0100.08020.97
5.6.100.0000.08721.14
5.6.90.0070.08020.97
5.6.80.0030.06720.37
5.6.70.0030.07720.50
5.6.60.0100.06320.38
5.6.50.0030.07320.51
5.6.40.0130.06720.49
5.6.30.0100.07320.51
5.6.20.0030.07320.22
5.6.10.0070.07320.35
5.6.00.0030.08320.37
5.5.350.0000.07720.33
5.5.340.0070.07720.66
5.5.330.0070.08720.89
5.5.320.0000.07320.63
5.5.310.0030.06320.66
5.5.300.0000.08320.73
5.5.290.0030.08320.75
5.5.280.0070.07320.90
5.5.270.0130.07720.80
5.5.260.0030.09020.87
5.5.250.0070.08020.69
5.5.240.0030.07320.27
5.5.230.0100.07320.11
5.5.220.0100.05320.15
5.5.210.0070.05720.35
5.5.200.0000.08320.16
5.5.190.0000.08319.99
5.5.180.0030.07720.34
5.5.160.0030.07320.11
5.5.150.0000.08320.20
5.5.140.0030.07720.24
5.5.130.0070.07320.00
5.5.120.0070.07320.31
5.5.110.0100.07320.23
5.5.100.0070.07720.13
5.5.90.0070.07720.14
5.5.80.0000.08020.20
5.5.70.0030.07020.04
5.5.60.0070.07320.11
5.5.50.0070.07719.88
5.5.40.0030.08020.21
5.5.30.0030.04320.11
5.5.20.0000.08320.03
5.5.10.0030.08019.99
5.5.00.0070.07319.99
5.4.450.0070.08019.39
5.4.440.0030.08319.38
5.4.430.0030.07719.35
5.4.420.0030.08319.23
5.4.410.0100.06719.32
5.4.400.0030.07019.13
5.4.390.0030.07019.01
5.4.380.0070.07319.01
5.4.370.0100.06719.04
5.4.360.0070.07318.91
5.4.350.0070.06719.08
5.4.340.0000.08719.14
5.4.320.0100.07319.20
5.4.310.0030.07319.05
5.4.300.0030.08019.12
5.4.290.0000.07319.01
5.4.280.0070.07019.03
5.4.270.0030.07018.93
5.4.260.0000.08019.05
5.4.250.0100.06718.91
5.4.240.0070.06319.06
5.4.230.0000.07318.92
5.4.220.0070.07718.91
5.4.210.0000.07719.16
5.4.200.0030.08019.11
5.4.190.0070.04718.89
5.4.180.0030.08018.91
5.4.170.0070.06318.91
5.4.160.0000.07319.01
5.4.150.0070.07319.00
5.4.140.0100.07016.43
5.4.130.0000.05016.24
5.4.120.0030.03316.46
5.4.110.0030.04716.24
5.4.100.0070.03016.25
5.4.90.0030.03316.42
5.4.80.0030.03316.35
5.4.70.0030.03016.52
5.4.60.0000.03716.48
5.4.50.0000.03016.49
5.4.40.0000.03016.27
5.4.30.0030.02716.46
5.4.20.0000.03016.30
5.4.10.0000.04016.48
5.4.00.0000.02715.79
5.3.290.0070.07714.65
5.3.280.0030.08314.65
5.3.270.0070.07314.65
5.3.260.0070.07714.71
5.3.250.0070.06714.68
5.3.240.0030.05314.66
5.3.230.0000.04014.62
5.3.220.0000.03714.48
5.3.210.0170.05714.65
5.3.200.0000.03714.66
5.3.190.0000.03714.66
5.3.180.0000.03714.57
5.3.170.0030.03714.61
5.3.160.0030.03714.62
5.3.150.0000.03314.61
5.3.140.0000.03314.56
5.3.130.0000.03014.52
5.3.120.0030.03014.60
5.3.110.0000.04014.46
5.3.100.0030.03014.08
5.3.90.0000.03714.09
5.3.80.0000.03713.91
5.3.70.0000.03314.07
5.3.60.0070.02314.10
5.3.50.0000.03313.86
5.3.40.0000.03014.06
5.3.30.0000.03014.00
5.3.20.0000.03313.76
5.3.10.0000.02713.64
5.3.00.0000.03313.61
5.2.170.0030.02011.23
5.2.160.0000.02711.05
5.2.150.0000.02311.00
5.2.140.0030.03011.11
5.2.130.0030.02311.20
5.2.120.0030.02711.18
5.2.110.0000.02311.17
5.2.100.0000.02310.96
5.2.90.0000.02311.01
5.2.80.0000.02311.10
5.2.70.0000.02310.98
5.2.60.0000.02311.05
5.2.50.0000.02711.03
5.2.40.0000.02310.98
5.2.30.0000.02711.06
5.2.20.0000.02310.91
5.2.10.0070.01710.86
5.2.00.0030.02310.75
5.1.60.0000.02010.57
5.1.50.0000.02310.57
5.1.40.0000.02010.57
5.1.30.0000.02010.57
5.1.20.0000.03010.57
5.1.10.0000.02010.57
5.1.00.0000.04010.57
5.0.50.0000.01710.57
5.0.40.0000.02310.57
5.0.30.0070.05710.57
5.0.20.0030.02010.57
5.0.10.0000.03710.57
5.0.00.0000.07010.57
4.4.90.0000.01310.57
4.4.80.0000.01710.57
4.4.70.0030.01010.57
4.4.60.0030.01010.57
4.4.50.0000.01310.57
4.4.40.0000.02310.57
4.4.30.0000.01310.57
4.4.20.0000.01310.57
4.4.10.0000.01310.57
4.4.00.0030.04010.57
4.3.110.0000.01310.57
4.3.100.0000.02310.57
4.3.90.0000.02710.57
4.3.80.0030.03010.57
4.3.70.0030.03310.57
4.3.60.0000.01310.57
4.3.50.0000.01710.57
4.3.40.0000.02310.57
4.3.30.0000.01710.57
4.3.20.0030.02010.57
4.3.10.0000.03010.57
4.3.00.0000.02010.57

preferences:
44.65 ms | 400 KiB | 5 Q