3v4l.org

run code in 300+ PHP versions simultaneously
$tree = array( 1 => array( 'parent' => 0 ), 2 => array( 'parent' => 1 ), 3 => array( 'parent' => 1 ), 4 => array( 'parent' => 2 ) ); $newtree = array(); foreach($tree as $leaf) { if (!isset($newtree[$leaf['parent']])) $newtree[$leaf['parent']]=array(); $newtree[$leaf['parent']][]=$leaf; } <?php>print_r($newtree); </?>

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.0150.00318.29
8.3.50.0110.00621.14
8.3.40.0090.00618.84
8.3.30.0080.00620.35
8.3.20.0000.00720.33
8.3.10.0070.00021.92
8.3.00.0040.00422.46
8.2.180.0150.00316.38
8.2.170.0030.01222.96
8.2.160.0070.00722.13
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0060.00317.47
8.2.110.0040.00722.11
8.2.100.0090.00317.78
8.2.90.0030.00519.08
8.2.80.0050.00317.97
8.2.70.0040.00417.38
8.2.60.0080.00417.92
8.2.50.0030.00518.07
8.2.40.0050.00318.15
8.2.30.0050.00218.02
8.2.20.0040.00417.45
8.2.10.0030.00617.61
8.2.00.0050.00317.47
8.1.280.0120.00325.92
8.1.270.0050.00324.66
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0000.01023.92
8.1.230.0040.00717.42
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.01017.23
8.1.190.0040.00417.40
8.1.180.0040.00418.10
8.1.170.0000.00818.57
8.1.160.0040.00418.61
8.1.150.0000.00718.55
8.1.140.0000.00717.35
8.1.130.0030.00317.74
8.1.120.0000.00717.21
8.1.110.0040.00417.24
8.1.100.0000.00817.32
8.1.90.0030.00617.38
8.1.80.0050.00217.33
8.1.70.0000.00717.19
8.1.60.0040.00417.46
8.1.50.0030.00517.36
8.1.40.0040.00417.38
8.1.30.0000.00717.52
8.1.20.0000.00817.56
8.1.10.0000.00717.36
8.1.00.0050.00217.40
8.0.300.0080.00018.77
8.0.290.0000.00716.63
8.0.280.0080.00018.39
8.0.270.0000.00717.09
8.0.260.0000.00616.66
8.0.250.0000.00716.83
8.0.240.0030.00616.66
8.0.230.0070.00016.88
8.0.220.0050.00316.63
8.0.210.0030.00316.76
8.0.200.0000.00616.87
8.0.190.0080.00016.84
8.0.180.0000.00816.84
8.0.170.0040.00416.68
8.0.160.0030.00516.81
8.0.150.0000.00716.73
8.0.140.0030.00316.71
8.0.130.0000.00513.32
8.0.120.0000.00816.61
8.0.110.0040.00416.83
8.0.100.0000.00716.79
8.0.90.0030.00316.76
8.0.80.0120.00416.78
8.0.70.0000.00816.71
8.0.60.0040.00416.80
8.0.50.0070.00016.77
8.0.30.0080.01016.82
8.0.20.0090.01317.40
8.0.10.0070.00016.88
8.0.00.0100.00816.77
7.4.330.0060.00015.00
7.4.320.0060.00016.50
7.4.300.0030.00316.39
7.4.290.0000.01116.24
7.4.280.0000.00716.47
7.4.270.0030.00316.23
7.4.260.0080.00013.25
7.4.250.0070.00016.41
7.4.240.0020.00516.36
7.4.230.0040.00416.38
7.4.220.0100.01016.43
7.4.210.0060.01116.44
7.4.200.0030.00316.32
7.4.190.0000.00716.59
7.4.160.0040.01216.36
7.4.150.0130.00317.40
7.4.140.0090.01217.86
7.4.130.0110.00616.45
7.4.120.0050.01116.47
7.4.110.0080.01016.46
7.4.100.0140.00916.28
7.4.90.0160.00016.36
7.4.80.0120.00819.39
7.4.70.0150.00616.37
7.4.60.0160.00016.30
7.4.50.0000.00816.27
7.4.40.0110.00322.77
7.4.30.0090.00916.36
7.3.330.0050.00013.08
7.3.320.0050.00013.10
7.3.310.0000.00716.20
7.3.300.0070.00016.09
7.3.290.0110.00416.08
7.3.280.0090.00616.13
7.3.270.0090.00817.40
7.3.260.0130.00316.30
7.3.250.0070.01116.29
7.3.240.0160.00016.34
7.3.230.0030.01316.39
7.3.210.0110.00716.34
7.3.200.0100.00619.39
7.3.190.0060.01216.34
7.3.180.0180.02816.33
7.3.170.0070.01016.27
7.3.160.0120.00316.25
7.2.330.0100.01016.39
7.2.320.0080.00816.57
7.2.310.0130.00316.21
7.2.300.0060.00916.54
7.2.290.0160.00016.34
5.5.80.0130.07320.01
5.5.70.0130.07020.06
5.5.60.0000.08020.05
5.5.50.0030.05020.05
5.5.40.0170.07020.02
5.5.30.0130.04720.14
5.5.20.0130.07020.14
5.5.10.0030.08020.03
5.5.00.0100.07720.09
5.4.240.0200.06318.95
5.4.230.0070.07319.03
5.4.220.0100.07019.16
5.4.210.0030.07318.87
5.4.200.0100.04719.04
5.4.190.0030.08019.04
5.4.180.0130.07319.12
5.4.170.0030.08019.02
5.4.160.0100.06718.89
5.4.150.0170.07018.88
5.4.140.0070.06716.47
5.4.130.0130.06016.41
5.4.120.0100.04016.40
5.4.110.0100.06016.43
5.4.100.0100.07016.48
5.4.90.0130.06716.49
5.4.80.0070.07316.50
5.4.70.0070.07716.42
5.4.60.0070.07316.47
5.4.50.0130.07016.32
5.4.40.0100.07016.52
5.4.30.0000.07716.44
5.4.20.0070.05316.36
5.4.10.0130.06716.51
5.4.00.0030.07715.94
5.3.290.0130.07714.61
5.3.280.0000.04714.57
5.3.270.0030.04714.43
5.3.260.0100.07714.58
5.3.250.0030.08014.55
5.3.240.0130.07014.59
5.3.230.0030.08014.60
5.3.220.0100.04314.52
5.3.210.0100.06714.55
5.3.200.0130.07714.57
5.3.190.0030.08014.56
5.3.180.0100.05014.54
5.3.170.0070.07314.47
5.3.160.0070.07014.50
5.3.150.0070.07014.54
5.3.140.0070.06014.38
5.3.130.0000.07014.54
5.3.120.0100.07014.51
5.3.110.0070.07714.55
5.3.100.0130.06014.04
5.3.90.0070.07313.92
5.3.80.0100.07313.95
5.3.70.0030.07314.00
5.3.60.0100.06313.91
5.3.50.0070.07313.85
5.3.40.0200.06013.90
5.3.30.0130.07013.83
5.3.20.0070.07713.79
5.3.10.0070.06313.79
5.3.00.0130.06313.79
5.2.170.0070.06713.79
5.2.160.0170.05313.79
5.2.150.0070.05713.79
5.2.140.0030.06713.79
5.2.130.0070.05713.79
5.2.120.0070.05713.79
5.2.110.0070.05013.79
5.2.100.0070.06013.79
5.2.90.0030.03713.79
5.2.80.0000.06013.79
5.2.70.0030.04313.79
5.2.60.0100.05713.79
5.2.50.0070.06313.79
5.2.40.0000.06313.79
5.2.30.0030.06313.79
5.2.20.0030.05713.79
5.2.10.0070.05713.79
5.2.00.0100.05313.79
5.1.60.0100.05013.79
5.1.50.0070.05313.79
5.1.40.0030.05713.79
5.1.30.0100.05313.79
5.1.20.0070.05313.79
5.1.10.0030.05013.79
5.1.00.0100.03313.79
5.0.50.0000.04713.79
5.0.40.0030.02313.79
5.0.30.0100.05713.79
5.0.20.0000.04713.79
5.0.10.0000.04013.79
5.0.00.0030.06713.79
4.4.90.0070.02713.79
4.4.80.0000.03713.79
4.4.70.0070.03313.79
4.4.60.0000.04013.79
4.4.50.0030.03713.79
4.4.40.0000.04713.79
4.4.30.0100.02713.79
4.4.20.0030.03313.79
4.4.10.0070.03013.79
4.4.00.0030.05013.79
4.3.110.0070.03013.79
4.3.100.0000.03313.79
4.3.90.0000.03713.79
4.3.80.0030.05013.79
4.3.70.0000.03713.79
4.3.60.0030.03013.79
4.3.50.0030.03713.79
4.3.40.0070.05013.79
4.3.30.0000.03313.79
4.3.20.0030.03013.79
4.3.10.0000.03713.79
4.3.00.0000.03713.79

preferences:
39.13 ms | 401 KiB | 5 Q