3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array( array('sn' => 1, 'name' => 'Clement', 'upper' => 0), array('sn' => 2, 'name' => 'Jean', 'upper' => 1), array('sn' => 3, 'name' => 'Annie', 'upper' => 1), array('sn' => 4, 'name' => 'Yuan', 'upper' => 2), array('sn' => 5, 'name' => 'Mei', 'upper' => 2), array('sn' => 6, 'name' => 'Blue', 'upper' => 3), array('sn' => 7, 'name' => 'Yang', 'upper' => 5), array('sn' => 8, 'name' => 'Lorinda', 'upper' => 0), ); $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.60.0070.01416.75
8.3.50.0100.00522.90
8.3.40.0110.00718.84
8.3.30.0110.00319.21
8.3.20.0080.00020.35
8.3.10.0080.00021.92
8.3.00.0050.00517.71
8.2.180.0080.00816.50
8.2.170.0130.00322.96
8.2.160.0100.00718.92
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0060.00319.25
8.2.110.0060.00322.11
8.2.100.0060.00617.78
8.2.90.0050.00318.03
8.2.80.0080.00019.31
8.2.70.0080.00017.75
8.2.60.0080.00017.63
8.2.50.0000.00817.63
8.2.40.0080.00518.60
8.2.30.0070.00620.05
8.2.20.0090.00317.75
8.2.10.0060.00617.97
8.2.00.0050.00617.78
8.1.280.0100.01025.92
8.1.270.0000.00823.96
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00621.36
8.1.230.0080.00320.97
8.1.220.0000.00817.91
8.1.210.0060.00318.78
8.1.200.0040.00417.35
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0100.00318.24
8.1.160.0090.00418.25
8.1.150.0100.00618.35
8.1.140.0090.00417.63
8.1.130.0120.00017.83
8.1.120.0070.00617.60
8.1.110.0060.00717.55
8.1.100.0110.00217.58
8.1.90.0080.00417.56
8.1.80.0100.00417.56
8.1.70.0070.00617.58
8.1.60.0100.00317.69
8.1.50.0050.00717.64
8.1.40.0040.00917.63
8.1.30.0090.00417.66
8.1.20.0110.00217.71
8.1.10.0060.00517.59
8.1.00.0050.00717.51
8.0.300.0070.00020.04
8.0.290.0040.00416.63
8.0.280.0060.00618.09
8.0.270.0080.00317.31
8.0.260.0050.00617.51
8.0.250.0050.00617.31
8.0.240.0080.00517.36
8.0.230.0110.00217.30
8.0.220.0080.00417.28
8.0.210.0060.00617.32
8.0.200.0110.00217.36
8.0.190.0100.00217.35
8.0.180.0080.00417.28
8.0.170.0080.00417.29
8.0.160.0080.00317.31
8.0.150.0070.00417.27
8.0.140.0060.00617.16
8.0.130.0050.00516.01
8.0.120.0060.00517.29
8.0.110.0040.00717.18
8.0.100.0090.00217.17
8.0.90.0050.00717.18
8.0.80.0050.00817.17
8.0.70.0080.00317.17
8.0.60.0060.00617.12
8.0.50.0060.00517.12
8.0.30.0100.00617.20
8.0.20.0090.00717.36
8.0.10.0020.00917.25
8.0.00.0080.00717.10
7.4.330.0060.00516.36
7.4.320.0080.00517.13
7.4.300.0030.00917.19
7.4.290.0050.00717.13
7.4.280.0060.00717.06
7.4.270.0070.00417.00
7.4.260.0070.00416.95
7.4.250.0050.00616.94
7.4.240.0020.00816.85
7.4.230.0070.00416.94
7.4.220.0070.00716.98
7.4.210.0020.01316.94
7.4.200.0070.00416.92
7.4.190.0100.00517.16
7.4.180.0070.00617.15
7.4.160.0130.00216.94
7.4.150.0130.00317.24
7.4.140.0090.00717.50
7.4.130.0080.00616.80
7.4.120.0090.00716.83
7.4.110.0110.00316.84
7.4.100.0080.00516.83
7.4.90.0070.00716.75
7.4.80.0080.00716.74
7.4.70.0100.00616.75
7.4.60.0080.00716.78
7.4.50.0090.00416.62
7.4.40.0080.00816.70
7.4.30.0080.01016.62
7.4.20.0100.00616.60
7.4.10.0080.01016.15
7.4.00.0060.01015.91
7.3.330.0130.00115.72
7.3.320.0130.00115.75
7.3.310.0090.00616.74
7.3.300.0090.00616.81
7.3.290.0080.00816.70
7.3.280.0100.00716.57
7.3.270.0190.00317.18
7.3.260.0170.00416.81
7.3.250.0110.00716.71
7.3.240.0110.00616.84
7.3.230.0150.00416.83
7.3.220.0110.00716.77
7.3.210.0130.00516.76
7.3.200.0120.00717.45
7.3.190.0120.00616.63
7.3.180.0100.00916.69
7.3.170.0130.00716.69
7.3.160.0090.00816.66
7.3.150.0080.00916.57
7.3.140.0080.01016.52
7.3.130.0090.00816.13
7.3.120.0100.00715.85
7.3.110.0100.00815.80
7.3.100.0080.00915.81
7.3.90.0100.00615.78
7.3.80.0070.01015.81
7.3.70.0080.00715.76
7.3.60.0080.00715.80
7.3.50.0100.00615.74
7.3.40.0080.00815.73
7.3.30.0080.00715.77
7.3.20.0080.00816.69
7.3.10.0090.00816.60
7.3.00.0080.00916.69
7.2.340.0110.00616.98
7.2.330.0130.00616.81
7.2.320.0180.00816.89
7.2.310.0120.00716.87
7.2.300.0070.01116.82
7.2.290.0100.00916.74
7.2.280.0110.00716.74
7.2.270.0110.00616.78
7.2.260.0080.00916.44
7.2.250.0090.00816.00
7.2.240.0090.00916.08
7.2.230.0090.00816.01
7.2.220.0080.00816.07
7.2.210.0090.00915.93
7.2.200.0090.00615.99
7.2.190.0060.01015.98
7.2.180.0090.00715.95
7.2.170.0070.00915.94
7.2.160.0080.00716.06
7.2.150.0090.00916.92
7.2.140.0080.00816.94
7.2.130.0070.00916.97
7.2.120.0080.00816.94
7.2.110.0080.00816.96
7.2.100.0090.00916.99
7.2.90.0080.00916.98
7.2.80.0110.00916.99
7.2.70.0090.00816.95
7.2.60.0100.00616.97
7.2.50.0090.00816.94
7.2.40.0150.00817.13
7.2.30.0120.01017.15
7.2.20.0170.00917.14
7.2.10.0190.00917.28
7.2.00.0230.01017.20
7.1.330.0100.00915.90
7.1.320.0090.00815.86
7.1.310.0110.00715.94
7.1.300.0110.00715.82
7.1.290.0110.00715.81
7.1.280.0090.00815.84
7.1.270.0090.00815.85
7.1.260.0100.00715.86
7.1.250.0080.00915.84
7.1.240.0100.00815.81
7.1.230.0100.00715.84
7.1.220.0110.00715.79
7.1.210.0100.00815.91
7.1.200.0100.00815.85
7.1.190.0110.00815.84
7.1.180.0100.00815.73
7.1.170.0110.00715.85
7.1.160.0130.00915.99
7.1.150.0280.00815.90
7.1.140.0270.00816.00
7.1.130.0200.00816.04
7.1.120.0230.00915.97
7.1.110.0160.00715.98
7.1.100.0170.00916.00
7.1.90.0150.00715.93
7.1.80.0220.00915.94
7.1.70.0230.00715.79
7.1.60.0250.00818.92
7.1.50.0360.00818.92
7.1.40.0280.00918.79
7.1.30.0220.01018.88
7.1.20.0270.01118.88
7.1.10.0320.00915.66
7.1.00.0200.00715.68
7.0.330.0160.00915.52
7.0.320.0130.00915.57
7.0.310.0150.00915.60
7.0.300.0140.00915.61
7.0.290.0260.01015.66
7.0.280.0150.00715.60
7.0.270.0280.00915.73
7.0.260.0260.01115.75
7.0.250.0200.00915.70
7.0.240.0220.00915.70
7.0.230.0270.00715.73
7.0.220.0270.00915.63
7.0.210.0370.00715.39
7.0.200.0190.00715.48
7.0.190.0310.01015.48
7.0.180.0310.01115.32
7.0.170.0370.00715.38
7.0.160.0300.00815.43
7.0.150.0340.01015.38
7.0.140.0320.00915.34
7.0.130.0270.00915.37
7.0.120.0290.00815.36
7.0.110.0300.00915.36
7.0.100.0290.00815.36
7.0.90.0290.00915.38
7.0.80.0320.00915.36
7.0.70.0220.01015.23
7.0.60.0260.00915.34
7.0.50.0210.00915.33
7.0.40.0250.00715.36
7.0.30.0280.00715.39
7.0.20.0420.00715.20
7.0.10.0300.00815.37
7.0.00.0270.00815.36
5.6.400.0140.00916.02
5.6.390.0140.00815.99
5.6.380.0120.01015.93
5.6.370.0160.00915.96
5.6.360.0150.00915.90
5.6.350.0130.01115.92
5.6.340.0150.00915.93
5.6.330.0160.00715.96
5.6.320.0170.00915.96
5.6.310.0130.01016.00
5.6.300.0190.02217.02
5.6.290.0150.02316.98
5.6.280.0150.02317.10
5.6.270.0150.02417.09
5.6.260.0160.02117.10
5.6.250.0140.02217.08
5.6.240.0160.02417.09
5.6.230.0140.02417.09
5.6.220.0160.02417.05
5.6.210.0150.02017.11
5.6.200.0140.02317.06
5.6.190.0140.02317.06
5.6.180.0150.02317.13
5.6.170.0150.02017.07
5.6.160.0140.02117.04
5.6.150.0120.02317.05
5.6.140.0160.02117.06
5.6.130.0150.02217.12
5.6.120.0160.02217.05
5.6.110.0130.02217.00
5.6.100.0130.02217.05
5.6.90.0130.02417.04
5.6.80.0130.02616.89
5.6.70.0170.01916.90
5.6.60.0150.02216.89
5.6.50.0110.02416.86
5.6.40.0150.02016.85
5.6.30.0120.02316.91
5.6.20.0140.02016.84
5.6.10.0150.02216.83
5.6.00.0140.02116.88
5.5.380.0160.02416.29
5.5.370.0130.02216.36
5.5.360.0150.02216.24
5.5.350.0150.02116.29
5.5.340.0160.02016.37
5.5.330.0160.02116.32
5.5.320.0160.02116.33
5.5.310.0160.02416.42
5.5.300.0140.02416.38
5.5.290.0150.02316.45
5.5.280.0180.01916.37
5.5.270.0160.02216.38
5.5.260.0160.02216.35
5.5.250.0160.02216.38
5.5.240.0150.02216.22
5.5.230.0140.02116.20
5.5.220.0130.02116.20
5.5.210.0150.02216.23
5.5.200.0140.02116.15
5.5.190.0150.02016.25
5.5.180.0170.02016.20
5.5.170.0160.00815.85
5.5.160.0150.02016.20
5.5.150.0160.02016.24
5.5.140.0160.02016.18
5.5.130.0150.02216.22
5.5.120.0140.02116.12
5.5.110.0160.02116.09
5.5.100.0160.02116.15
5.5.90.0130.02116.23
5.5.80.0130.02016.16
5.5.70.0150.02116.22
5.5.60.0170.01816.14
5.5.50.0140.02116.13
5.5.40.0170.01816.21
5.5.30.0150.01916.16
5.5.20.0150.02116.17
5.5.10.0160.02016.17
5.5.00.0160.02116.15
5.4.450.0150.01814.54
5.4.440.0130.01814.54
5.4.430.0120.02014.56
5.4.420.0140.02114.51
5.4.410.0150.01914.58
5.4.400.0140.02014.46
5.4.390.0120.02114.42
5.4.380.0120.02014.46
5.4.370.0140.01814.40
5.4.360.0130.02114.43
5.4.350.0120.02114.44
5.4.340.0120.02014.45
5.4.330.0110.00813.05
5.4.320.0130.01814.45
5.4.310.0110.02114.42
5.4.300.0140.02114.42
5.4.290.0120.02014.44
5.4.280.0130.02014.42
5.4.270.0140.01814.41
5.4.260.0130.01814.40
5.4.250.0130.01714.38
5.4.240.0140.02014.48
5.4.230.0110.02014.40
5.4.220.0120.02014.36
5.4.210.0110.02014.37
5.4.200.0130.02114.39
5.4.190.0140.01814.41
5.4.180.0130.02114.35
5.4.170.0140.01914.42
5.4.160.0130.01714.43
5.4.150.0120.01914.46
5.4.140.0140.01913.89
5.4.130.0130.01813.90
5.4.120.0110.01813.86
5.4.110.0120.01813.89
5.4.100.0110.02013.89
5.4.90.0110.01713.85
5.4.80.0130.01813.89
5.4.70.0130.01813.96
5.4.60.0130.01913.90
5.4.50.0120.01913.95
5.4.40.0120.01913.91
5.4.30.0140.01613.90
5.4.20.0150.01913.93
5.4.10.0150.01813.90
5.4.00.0110.02013.74
5.3.290.0110.02013.81
5.3.280.0110.02013.71
5.3.270.0130.02113.75
5.3.260.0120.01913.67
5.3.250.0140.01813.72
5.3.240.0120.02113.61
5.3.230.0130.01913.66
5.3.220.0120.02013.62
5.3.210.0120.01913.66
5.3.200.0140.01713.62
5.3.190.0120.02013.65
5.3.180.0130.01813.74
5.3.170.0120.01813.74
5.3.160.0120.01913.72
5.3.150.0130.01913.77
5.3.140.0130.01813.71
5.3.130.0130.02013.68
5.3.120.0130.02113.72
5.3.110.0120.02013.71
5.3.100.0130.01913.56
5.3.90.0130.01813.60
5.3.80.0120.01813.49
5.3.70.0120.01913.45
5.3.60.0120.01913.53
5.3.50.0120.01913.49
5.3.40.0130.01813.48
5.3.30.0120.02013.49
5.3.20.0100.02013.43
5.3.10.0160.01713.31
5.3.00.0150.02013.26

preferences:
53.94 ms | 401 KiB | 5 Q