3v4l.org

run code in 200+ php & hhvm versions
<?php $source=json_decode('[{"parentTitle":"Winner 2009","catTitle":"Mas Muster","title":"drm202"},{"parentTitle":"Winner 2009","catTitle":"Mas Muster","title":"drm202"},{"parentTitle":"Winner 2011","catTitle":"Josh Frank","title":"A bird in the cage"},{"parentTitle":"Winner 2011","catTitle":"Josh Frank","title":"cue & repeat"}]'); $result=array(); array_walk($source,function($v,$i)use(&$result){ if(!isset($result[$v->parentTitle])) $result[$v->parentTitle]=array(); if(!isset($result[$v->parentTitle][$v->catTitle])) $result[$v->parentTitle][$v->catTitle]=array(); if(!in_array($v->title,$result[$v->parentTitle][$v->catTitle])) $result[$v->parentTitle][$v->catTitle][]=$v->title; }); print_r($result); // just to debug echo "<ul>"; foreach($result as $key=>$sub){ echo "<li>".htmlentities($key,ENT_COMPAT,"UTF-8"); echo "\n<ul>"; foreach($sub as $k=>$s){ echo "<li>".htmlentities($k,ENT_COMPAT,"UTF-8"); echo "\n<ul>"; foreach($s as $i=>$v){ echo "<li>".htmlentities($v,ENT_COMPAT,"UTF-8")."</li>\n"; } echo "</ul>\n</li>"; } echo "</ul>\n</li>"; } echo "</ul>";

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.3.10.0060.00616.64
7.3.00.0090.00616.70
7.2.130.0000.01016.68
7.2.120.0060.00616.97
7.2.110.0040.00717.06
7.2.100.0000.01416.92
7.2.90.0100.00017.08
7.2.80.0000.01416.78
7.2.70.0040.00816.79
7.2.60.0070.00816.90
7.2.50.0080.00816.99
7.2.40.0030.01617.09
7.2.30.0120.00916.88
7.2.20.0140.01116.87
7.2.10.0070.01416.76
7.2.00.0020.01518.24
7.1.250.0100.00315.75
7.1.200.0030.01015.75
7.1.100.0000.01218.08
7.1.70.0040.00717.02
7.1.60.0060.01919.82
7.1.50.0040.00716.99
7.1.00.0170.06322.30
7.0.200.0000.00916.90
7.0.140.0070.07022.01
7.0.60.0130.07021.88
7.0.50.0100.05018.00
7.0.40.0130.03719.96
7.0.30.0330.05020.26
7.0.20.0370.08020.23
7.0.10.0070.08320.15
7.0.00.0070.08320.12
5.6.280.0030.07320.91
5.6.210.0170.06320.66
5.6.200.0070.08718.23
5.6.190.0070.04320.45
5.6.180.0270.03320.77
5.6.170.0300.08020.61
5.6.160.0030.08020.71
5.6.150.0030.04318.28
5.6.140.0100.03318.15
5.6.130.0100.07718.21
5.6.120.0030.04020.97
5.6.110.0000.08020.98
5.6.100.0170.08021.05
5.6.90.0270.06321.04
5.6.80.0030.08020.36
5.5.350.0000.08320.42
5.5.340.0070.04017.96
5.5.330.0130.08020.27
5.5.320.0370.06020.34
5.5.310.0300.05720.27
5.5.300.0070.04318.07
5.5.290.0130.07018.09
5.5.280.0070.07020.99
5.5.270.0030.07020.73
5.5.260.0100.06020.90
5.5.250.0000.08320.62
5.5.240.0170.07720.16
5.4.450.0000.05019.57
5.4.440.0100.07319.52
5.4.430.0070.07719.47
5.4.420.0100.04019.24
5.4.410.0030.03719.17
5.4.400.0100.07319.16
5.4.390.0100.04018.87
5.4.380.0070.07319.20
5.4.370.0070.07019.08
5.4.360.0100.06718.85
5.4.350.0130.04018.99
5.4.340.0070.07719.08
5.4.320.0130.07019.24
5.4.310.0130.06718.92
5.4.300.0070.06719.24
5.4.290.0000.04318.87
5.4.280.0070.04018.85
5.4.270.0030.04019.15
5.4.260.0070.04719.07
5.4.250.0130.07319.23
5.4.240.0170.06719.11
5.4.230.0030.05718.85
5.4.220.0130.06719.23
5.4.210.0100.06019.20
5.4.200.0030.07719.15
5.4.190.0200.06018.86
5.4.180.0030.04319.13
5.4.170.0100.05719.13
5.4.160.0000.05018.94
5.4.150.0170.06718.97
5.4.140.0100.07716.55
5.4.130.0070.07716.50
5.4.120.0030.04016.54
5.4.110.0070.04716.39
5.4.100.0130.04716.30
5.4.90.0030.07316.39
5.4.80.0030.06316.39
5.4.70.0030.04016.32
5.4.60.0000.08016.45
5.4.50.0000.07016.43
5.4.40.0070.06016.46
5.4.30.0100.06016.36
5.4.20.0030.04716.39
5.4.10.0030.05716.37
5.4.00.0070.03315.79
5.3.290.0130.07314.71
5.3.280.0100.07314.77
5.3.270.0000.05014.65
5.3.260.0000.08314.61
5.3.250.0100.03314.63
5.3.240.0100.07314.50
5.3.230.0030.07014.68
5.3.220.0030.04014.73
5.3.210.0100.03714.63
5.3.200.0070.04714.59
5.3.190.0070.04014.74
5.3.180.0070.04314.59
5.3.170.0070.04014.59
5.3.160.0000.08014.61
5.3.150.0030.07714.60
5.3.140.0030.06714.59
5.3.130.0170.07314.72
5.3.120.0200.06314.48
5.3.110.0130.07014.57
5.3.100.0100.03714.04
5.3.90.0070.05714.03
5.3.80.0030.04714.07
5.3.70.0070.07313.98
5.3.60.0100.03314.05
5.3.50.0070.04314.01
5.3.40.0130.06013.85
5.3.30.0130.06013.96
5.3.20.0070.07313.76
5.3.10.0030.05313.81
5.3.00.0130.07013.70
5.2.170.0070.04711.04
5.2.160.0070.04311.10
5.2.150.0070.06711.00
5.2.140.0000.05011.09
5.2.130.0070.04711.03
5.2.120.0000.03011.09
5.2.110.0100.06011.06
5.2.100.0000.04310.92
5.2.90.0070.06011.07
5.2.80.0070.06011.06
5.2.70.0030.06711.08
5.2.60.0030.05011.02
5.2.50.0030.05710.84
5.2.40.0000.04311.07
5.2.30.0070.06011.05
5.2.20.0070.05010.95
5.2.10.0000.04310.86
5.2.00.0000.03310.72
5.1.60.0000.04010.69
5.1.50.0100.04310.69
5.1.40.0030.05710.69
5.1.30.0070.05310.69
5.1.20.0030.03310.69
5.1.10.0030.03710.69
5.1.00.0170.03710.69
5.0.50.0030.02010.69
5.0.40.0070.01310.69
5.0.30.0070.04710.69
5.0.20.0070.04310.69
5.0.10.0030.04010.69
5.0.00.0070.06310.69
4.4.90.0000.03010.69
4.4.80.0030.03710.69
4.4.70.0030.03710.69
4.4.60.0100.03010.69
4.4.50.0000.03710.69
4.4.40.0000.04010.69
4.4.30.0000.03010.69
4.4.20.0030.02010.69
4.4.10.0030.02310.69
4.4.00.0030.02310.69
4.3.110.0030.01310.69
4.3.100.0070.02310.69
4.3.90.0030.03710.69
4.3.80.0000.05310.69
4.3.70.0000.02310.69
4.3.60.0070.01710.69
4.3.50.0030.03010.69
4.3.40.0000.05710.69
4.3.30.0030.03710.69
4.3.20.0030.03710.69
4.3.10.0000.04010.69
4.3.00.0000.03710.69