3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array( array('id' => 2, 'name' => 'Clement', 'upper' => 0), array('id' => 1, 'name' => 'Jean', 'upper' => 1), array('id' => 1, 'name' => 'Annie', 'upper' => 1), ); $map = array(); foreach ($input as $node) { // init self if (!array_key_exists($node['sn'], $map)) { $map[$node['sn']] = array('self' => $node['name']); } else { $map[$node['sn']]['self'] = $node['name']; } // init parent if (!array_key_exists($node['upper'], $map)) { $map[$node['upper']] = array(); } // add to parent $map[$node['upper']][$node['sn']] = & $map[$node['sn']]; } print_r($map[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.3.70.0130.00716.63
8.3.60.0150.00318.38
8.3.50.0110.00822.12
8.3.40.0060.01218.98
8.3.30.0030.01019.17
8.3.20.0070.00020.34
8.3.10.0040.00423.54
8.3.00.0070.00019.02
8.2.190.0100.00716.88
8.2.180.0110.00718.66
8.2.170.0110.00422.96
8.2.160.0070.00722.21
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0030.00621.00
8.2.110.0060.00322.16
8.2.100.0080.00418.03
8.2.90.0000.00817.75
8.2.80.0000.00818.85
8.2.70.0040.00417.93
8.2.60.0000.00818.16
8.2.50.0040.00418.10
8.2.40.0000.00819.42
8.2.30.0000.00819.33
8.2.20.0080.00017.72
8.2.10.0050.00318.22
8.2.00.0060.00317.91
8.1.280.0140.00725.92
8.1.270.0000.00919.01
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0090.00020.64
8.1.230.0060.00622.70
8.1.220.0040.00417.80
8.1.210.0060.00318.77
8.1.200.0100.00017.35
8.1.190.0000.00817.25
8.1.180.0040.00418.97
8.1.170.0030.00518.59
8.1.160.0040.00418.90
8.1.150.0040.00418.92
8.1.140.0050.00217.40
8.1.130.0050.00317.76
8.1.120.0000.00717.47
8.1.110.0000.00817.39
8.1.100.0040.00417.48
8.1.90.0050.00317.48
8.1.80.0040.00717.50
8.1.70.0020.00517.52
8.1.60.0030.00517.62
8.1.50.0000.00817.54
8.1.40.0060.00617.54
8.1.30.0080.00017.75
8.1.20.0030.00617.62
8.1.10.0040.00417.54
8.1.00.0080.00017.44
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0040.00418.40
8.0.270.0040.00417.28
8.0.260.0030.00317.31
8.0.250.0000.00717.06
8.0.240.0030.00317.06
8.0.230.0030.00317.07
8.0.220.0000.00717.01
8.0.210.0000.00816.99
8.0.200.0000.00617.05
8.0.190.0060.00316.98
8.0.180.0000.00817.03
8.0.170.0000.00716.99
8.0.160.0040.00416.90
8.0.150.0000.00816.89
8.0.140.0030.00516.95
8.0.130.0000.00613.29
8.0.120.0040.00416.84
8.0.110.0040.00416.90
8.0.100.0030.00517.05
8.0.90.0040.00417.06
8.0.80.0120.00316.98
8.0.70.0040.00416.89
8.0.60.0040.00416.98
8.0.50.0000.00816.84
8.0.30.0120.01017.10
8.0.20.0110.01117.40
8.0.10.0040.00416.98
8.0.00.0120.00616.78
7.4.330.0000.00515.07
7.4.320.0000.00616.56
7.4.300.0000.00716.53
7.4.290.0040.00416.54
7.4.280.0000.00816.64
7.4.270.0030.00316.63
7.4.260.0080.00316.63
7.4.250.0000.00816.55
7.4.240.0030.00316.52
7.4.230.0000.00716.64
7.4.220.0090.00916.64
7.4.210.0040.01716.58
7.4.200.0000.00716.47
7.4.160.0110.00416.55
7.4.150.0100.01417.40
7.4.140.0150.00717.86
7.4.130.0140.00316.47
7.4.120.0130.00616.52
7.4.110.0150.00916.74
7.4.100.0130.00616.70
7.4.90.0100.00616.50
7.4.80.0090.00919.39
7.4.70.0130.00316.61
7.4.60.0100.00716.45
7.4.50.0000.00816.57
7.4.40.0110.00616.66
7.4.30.0030.01316.72
7.4.00.0090.00614.89
7.3.330.0000.00513.22
7.3.320.0000.00613.38
7.3.310.0030.00316.16
7.3.300.0000.00716.38
7.3.290.0070.00716.42
7.3.280.0110.00616.40
7.3.270.0070.01417.40
7.3.260.0070.01016.36
7.3.250.0050.01216.41
7.3.240.0120.00616.31
7.3.230.0110.01216.39
7.3.210.0120.00616.58
7.3.200.0160.00819.39
7.3.190.0070.01316.57
7.3.180.0070.01016.30
7.3.170.0100.00716.39
7.3.160.0070.01016.41
7.3.10.0040.01116.82
7.3.00.0060.00616.74
7.2.330.0100.01016.45
7.2.320.0030.01416.42
7.2.310.0110.00716.64
7.2.300.0070.01116.44
7.2.290.0110.00616.78
7.2.130.0030.00616.85
7.2.120.0070.01016.98
7.2.110.0040.01116.98
7.2.100.0030.00616.98
7.2.90.0120.00017.11
7.2.80.0030.01017.07
7.2.70.0000.01317.07
7.2.60.0090.00217.10
7.2.50.0070.00616.72
7.2.40.0040.00816.99
7.2.30.0040.01117.07
7.2.20.0090.00316.92
7.2.10.0060.00316.93
7.2.00.0030.00918.28
7.1.250.0000.00915.76
7.1.200.0060.00615.66
7.1.100.0040.00718.22
7.1.70.0100.00017.34
7.1.60.0060.01919.22
7.1.50.0070.01416.93
7.1.00.0070.07322.39
7.0.200.0040.00416.73
7.0.140.0030.07322.09
7.0.60.0100.04019.79
7.0.50.0000.07717.80
7.0.40.0230.07320.40
7.0.30.0230.05020.04
7.0.20.0370.07720.00
7.0.10.0370.06020.02
7.0.00.0200.07320.04
5.6.280.0030.07320.92
5.6.210.0000.05320.70
5.6.200.0030.04318.23
5.6.190.0030.04320.49
5.6.180.4400.05020.27
5.6.170.0230.06020.50
5.6.160.0070.06020.37
5.6.150.0000.07318.13
5.6.140.0130.07318.18
5.6.130.0130.07018.15
5.6.120.0030.08021.12
5.6.110.0100.04721.00
5.6.100.0130.07320.98
5.6.90.0170.06320.94
5.6.80.0170.07020.42
5.6.70.0430.06320.36
5.5.350.0330.07020.44
5.5.340.0070.04017.92
5.5.330.0070.08320.43
5.5.320.0470.07020.28
5.5.310.0400.07020.13
5.5.300.0130.03018.00
5.5.290.0030.04017.97
5.5.280.0170.08020.76
5.5.270.0100.07020.83
5.5.260.0130.07020.76
5.5.250.0070.06020.66
5.5.240.0330.05720.19
5.4.450.0230.04319.41
5.4.440.0170.04719.40
5.4.430.0200.07319.09
5.4.420.0230.04019.56
5.4.410.0270.06319.25
5.4.400.0270.07019.08
5.4.390.0170.07319.13
5.4.380.0200.07019.24
5.4.370.0230.03719.23
5.4.360.0200.08019.13
5.4.350.0330.06019.14
5.4.340.0270.04018.89
5.4.320.0200.07019.13
5.4.310.0100.04718.88
5.4.300.0270.06018.88
5.4.290.0300.06719.05
5.4.280.0230.07318.77
5.4.270.0170.07019.07
5.4.260.0270.05318.91
5.4.250.0230.07019.22
5.4.240.0230.06718.91
5.4.230.0200.07318.94
5.4.220.0130.04319.23
5.4.210.0170.03719.21
5.4.200.0230.06319.04
5.4.190.0270.07319.04
5.4.180.0300.06019.11
5.4.170.0330.06019.07
5.4.160.0230.04019.09
5.4.150.0230.05018.89
5.4.140.0200.04016.44
5.4.130.0300.06016.21
5.4.120.0230.05016.25
5.4.110.0200.04316.22
5.4.100.0300.03316.38
5.4.90.0270.04316.38
5.4.80.0130.05016.39
5.4.70.0270.06316.44
5.4.60.0200.04316.46
5.4.50.0200.04016.36
5.4.40.0100.04716.36
5.4.30.0230.03716.39
5.4.20.0130.04716.03
5.4.10.0200.06016.40
5.4.00.0300.03315.73
5.3.290.0270.04314.55
5.3.280.0230.05014.69
5.3.270.0230.03714.46
5.3.260.0230.06714.59
5.3.250.0330.06014.48
5.3.240.0270.04014.70
5.3.230.0170.06714.44
5.3.220.0200.04714.44
5.3.210.0300.07014.43
5.3.200.0270.07014.43
5.3.190.0270.03314.52
5.3.180.0200.03714.61
5.3.170.0230.03314.52
5.3.160.0230.03714.47
5.3.150.0200.03714.44
5.3.140.0170.04314.40
5.3.130.0270.07014.50
5.3.120.0270.05314.39
5.3.110.0200.04314.45
5.3.100.0270.07014.05
5.3.90.0200.06713.88
5.3.80.0300.03013.97
5.3.70.0230.07713.88
5.3.60.0270.06713.91
5.3.50.0270.04014.00
5.3.40.0300.07013.89
5.3.30.0300.06313.90
5.3.20.0230.06313.54
5.3.10.0200.05013.61
5.3.00.0270.03713.69
5.2.170.0200.06311.23
5.2.160.0170.06310.99
5.2.150.0200.03711.31
5.2.140.0200.02711.00
5.2.130.0200.05711.13
5.2.120.0200.06311.05
5.2.110.0200.06011.15
5.2.100.0170.04011.18
5.2.90.0170.03710.95
5.2.80.0170.03011.01
5.2.70.0100.05311.04
5.2.60.0230.04310.91
5.2.50.0270.04010.86
5.2.40.0170.03711.04
5.2.30.0200.05710.99
5.2.20.0170.05710.97
5.2.10.0100.04010.93
5.2.00.0170.02310.65
5.1.60.0100.02710.05
5.1.50.0200.0479.88
5.1.40.0130.0479.99
5.1.30.0170.04310.38
5.1.20.0130.03310.40
5.1.10.0130.03710.19
5.1.00.0170.0209.94
5.0.50.0070.0308.65
5.0.40.0100.0208.31
5.0.30.0170.0408.13
5.0.20.0030.0278.09
5.0.10.0100.0338.16
5.0.00.0070.0308.21
4.4.90.0200.0207.61
4.4.80.0170.0177.63
4.4.70.0030.0207.64
4.4.60.0070.0177.66
4.4.50.0100.0137.66
4.4.40.0030.0277.67
4.4.30.0030.0177.67
4.4.20.0000.0207.67
4.4.10.0030.0207.69
4.4.00.0030.0307.70
4.3.110.0030.0177.70
4.3.100.0100.0237.70
4.3.90.0070.0207.71
4.3.80.0030.0277.73
4.3.70.0070.0137.73
4.3.60.0030.0177.73
4.3.50.0030.0177.74
4.3.40.0070.0237.74
4.3.30.0000.0177.75
4.3.20.0000.0177.78
4.3.10.0000.0207.79
4.3.00.0030.0177.79

preferences:
45.51 ms | 401 KiB | 5 Q