3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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]);
based on uuUTM

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0070.00716.90
7.2.00.0070.00719.52
7.1.200.0030.00515.76
7.1.100.0060.00618.23
7.1.70.0050.00317.01
7.1.60.0140.01119.22
7.1.50.0030.01617.11
7.1.00.0070.07322.54
7.0.200.0070.00716.90
7.0.140.0030.05022.01
7.0.60.0130.04320.05
7.0.50.0030.04317.87
7.0.40.0130.07720.06
7.0.30.0230.08320.18
7.0.20.0230.05320.09
7.0.10.0100.07720.09
7.0.00.0070.06720.32
5.6.280.0030.07321.06
5.6.210.0030.07020.74
5.6.200.0070.04318.22
5.6.190.0070.06720.60
5.6.180.0270.04020.33
5.6.170.0270.07020.42
5.6.160.0030.08320.48
5.6.150.0130.06718.06
5.6.140.0170.07018.12
5.6.130.0170.03318.21
5.6.120.0030.04020.96
5.6.110.0000.07721.11
5.6.100.0170.07020.97
5.6.90.0000.04320.97
5.6.80.0200.04720.38
5.5.350.0170.07020.46
5.5.340.0070.05318.07
5.5.330.0070.04020.21
5.5.320.0200.05720.50
5.5.310.0300.06020.18
5.5.300.0100.07717.96
5.5.290.0000.04317.96
5.5.280.0070.08020.87
5.5.270.0030.09020.75
5.5.260.0170.07320.79
5.5.250.0130.07720.67
5.5.240.0100.07320.16
5.4.450.0730.04719.07
5.4.440.0800.06319.15
5.4.430.0170.06719.53
5.4.420.0230.04719.16
5.4.410.0200.04719.45
5.4.400.0170.06319.05
5.4.390.0130.05718.93
5.4.380.0600.06318.66
5.4.370.0770.05718.71
5.4.360.0530.06018.50
5.4.350.0470.06718.63
5.4.340.0870.05718.66
5.4.320.0870.05018.68
5.4.310.0700.05018.63
5.4.300.0600.06018.61
5.4.290.0730.06718.50
5.4.280.0730.06318.71
5.4.270.0500.05318.62
5.4.260.0670.05318.67
5.4.250.0670.05318.50
5.4.240.0700.05318.77
5.4.230.0300.05318.70
5.4.220.0700.05018.67
5.4.210.0670.05018.64
5.4.200.0900.06316.50
5.4.190.0630.07318.56
5.4.180.0600.06018.68
5.4.170.0800.06018.76
5.4.160.0830.05018.44
5.4.150.0700.06018.66
5.4.140.0730.04716.18
5.4.130.0970.06316.27
5.4.120.0730.06716.25
5.4.110.0630.05316.15
5.4.100.0870.04716.20
5.4.90.0730.05316.13
5.4.80.0730.04716.25
5.4.70.0800.05316.29
5.4.60.0870.07316.20
5.4.50.0830.05016.22
5.4.40.0970.05316.19
5.4.30.1030.06016.05
5.4.20.0870.04316.32
5.4.10.0630.05716.14
5.4.00.0800.05015.63
5.3.290.0730.06014.76
5.3.280.0800.05014.62
5.3.270.0870.05714.58
5.3.260.0870.05314.60
5.3.250.0830.05014.55
5.3.240.0800.05714.61
5.3.230.0900.05314.70
5.3.220.0830.05314.55
5.3.210.0970.05714.50
5.3.200.0700.05014.48
5.3.190.1130.07314.67
5.3.180.0970.07014.65
5.3.170.1200.06014.66
5.3.160.1030.06314.66
5.3.150.0800.05714.46
5.3.140.0730.06014.52
5.3.130.0900.05014.53
5.3.120.0900.06014.65
5.3.110.0800.05714.46
5.3.100.0830.06314.07
5.3.90.0970.04314.07
5.3.80.1030.04013.95
5.3.70.1100.06713.94
5.3.60.0900.05314.05
5.3.50.0870.05013.94
5.3.40.0870.06013.86
5.3.30.0870.05013.82
5.3.20.0900.05013.60
5.3.10.0870.05013.64
5.3.00.0970.04713.73
5.2.170.0730.04011.20
5.2.160.0730.04311.30
5.2.150.0770.04311.29
5.2.140.0770.03711.29
5.2.130.0770.04311.16
5.2.120.0770.04711.07
5.2.110.0700.04711.07
5.2.100.0730.04711.14
5.2.90.0800.04711.09
5.2.80.0700.04711.13
5.2.70.0870.04311.13
5.2.60.0770.03711.19
5.2.50.0730.04010.93
5.2.40.0600.04710.98
5.2.30.0630.04311.13
5.2.20.0700.03010.90
5.2.10.0500.04710.96
5.2.00.0730.03310.73
5.1.60.0670.03010.05
5.1.50.0600.04010.12
5.1.40.0700.03310.12
5.1.30.0700.04010.40
5.1.20.0800.04010.50
5.1.10.0570.04010.21
5.1.00.0670.04310.14
5.0.50.0330.0308.63
5.0.40.0400.0178.54
5.0.30.0270.0478.21
5.0.20.0270.0408.28
5.0.10.0270.0308.25
5.0.00.0300.0438.17
4.4.90.0300.0235.96
4.4.80.0330.0275.87
4.4.70.0230.0275.93
4.4.60.0270.0235.93
4.4.50.0270.0235.84
4.4.40.0330.0305.88
4.4.30.0330.0205.89
4.4.20.0300.0205.95
4.4.10.0300.0235.97
4.4.00.0270.0375.91
4.3.110.0270.0235.82
4.3.100.0370.0175.89
4.3.90.0270.0235.81
4.3.80.0330.0305.80
4.3.70.0300.0205.79
4.3.60.0370.0135.80
4.3.50.0330.0235.81
4.3.40.0330.0305.77
4.3.30.0130.0235.12
4.3.20.0230.0135.12
4.3.10.0130.0235.12
4.3.00.0170.0277.61