3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [ 0 => [ 0 => [1,2,3], // +1 1 => [4,5] // +1 ], 1 => [ 0 => [6,7], // +1 1 => [8,9,10] // +1 ] ]; function monkeys($array, $count) { foreach ($array as $sub) { if (! is_array($sub)) { return ++$count; } else { return ($count += monkeys($sub, $count)); } } } $count = 0; var_dump(monkeys($array,$count)); var_dump($count);
based on 7tSYF

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.00.0000.01319.45
7.1.100.0040.00718.28
7.1.70.0040.00417.20
7.1.60.0090.00619.61
7.1.50.0090.01216.97
7.1.00.0070.07022.48
7.0.200.0060.00316.84
7.0.140.0170.06022.09
7.0.60.0030.04320.08
7.0.50.0030.04717.86
7.0.40.0030.05320.13
7.0.30.0270.04720.07
7.0.20.0270.06320.08
7.0.10.0100.05320.10
7.0.00.0100.04020.12
5.6.280.0030.07021.11
5.6.210.0070.07720.62
5.6.200.0070.07718.19
5.6.190.0070.08720.57
5.6.180.0170.04020.48
5.6.170.0100.04720.44
5.6.160.0030.05720.55
5.6.150.0130.07318.15
5.6.140.0030.08318.15
5.6.130.0030.04718.27
5.6.120.0000.04320.90
5.6.110.0030.04721.00
5.6.100.0170.05721.14
5.6.90.0130.05721.08
5.6.80.0170.07020.40
5.6.70.0370.06720.40
5.5.350.0070.08320.38
5.5.340.0030.03718.05
5.5.330.0130.07720.40
5.5.320.0130.05020.34
5.5.310.0330.05320.30
5.5.300.0130.07017.98
5.5.290.0070.08718.01
5.5.280.0100.08020.87
5.5.270.0000.04720.95
5.5.260.0000.04320.86
5.5.250.0070.06320.69
5.5.240.0130.07720.26
5.4.450.0170.07319.28
5.4.440.0200.03719.54
5.4.430.0300.02719.48
5.4.420.0170.04019.52
5.4.410.0200.04719.45
5.4.400.0100.04319.15
5.4.390.0200.03318.99
5.4.380.0200.04319.25
5.4.370.0200.04718.87
5.4.360.0170.05019.25
5.4.350.0230.04319.20
5.4.340.0230.03719.09
5.4.320.0300.05019.24
5.4.310.0270.06719.19
5.4.300.0170.04018.98
5.4.290.0130.04319.09
5.4.280.0200.05019.21
5.4.270.0130.03318.83
5.4.260.0170.03719.00
5.4.250.0170.03719.14
5.4.240.0200.08018.85
5.4.230.0130.05019.13
5.4.220.0230.07019.08
5.4.210.0200.07319.09
5.4.200.0170.07019.21
5.4.190.0270.06718.93
5.4.180.0200.04719.18
5.4.170.0200.06719.21
5.4.160.0170.04719.12
5.4.150.0230.03019.18
5.4.140.0100.04016.29
5.4.130.0300.06316.39
5.4.120.0170.04716.38
5.4.110.0170.04716.19
5.4.100.0270.05316.52
5.4.90.0170.03716.34
5.4.80.0170.03316.37
5.4.70.0100.04316.54
5.4.60.0100.04016.38
5.4.50.0200.03316.42
5.4.40.0130.04016.24
5.4.30.0200.03716.42
5.4.20.0230.06316.33
5.4.10.0170.05016.39
5.4.00.0070.07715.79
5.3.290.0070.04314.51
5.3.280.0930.06714.61
5.3.270.2100.04314.55
5.3.260.2100.03714.48
5.3.250.2000.04314.43
5.3.240.2200.04714.46
5.3.230.1930.03314.55
5.3.220.2230.05014.43
5.3.210.2170.04014.58
5.3.200.2130.04014.41
5.3.190.0000.04714.41
5.3.180.0030.04314.55
5.3.170.1030.03714.40
5.3.160.0170.07714.61
5.3.150.0030.07314.58
5.3.140.0800.06714.43
5.3.130.2170.05014.57
5.3.120.2130.04314.57
5.3.110.2270.04314.49
5.3.100.2130.04013.99
5.3.90.1970.03713.97
5.3.80.2100.04314.11
5.3.70.2200.03713.84
5.3.60.2100.04313.84
5.3.50.1370.04713.74
5.3.40.0030.03713.99
5.3.30.0000.07013.96
5.3.20.1730.04013.48
5.3.10.1930.03313.60
5.3.00.2100.04013.73
5.2.170.1700.03010.99
5.2.160.1870.03711.30
5.2.150.1770.04311.09
5.2.140.1900.03711.05
5.2.130.1670.03311.05
5.2.120.1530.02710.94
5.2.110.1600.02310.96
5.2.100.1570.03011.18
5.2.90.0600.03011.06
5.2.80.0070.03711.17
5.2.70.0000.03010.98
5.2.60.0230.04311.13
5.2.50.1670.02710.90
5.2.40.1600.03011.07
5.2.30.1300.03011.05
5.2.20.1330.02710.82
5.2.10.1300.03310.78
5.2.00.1400.03310.79
5.1.60.1300.0239.89
5.1.50.1400.02310.12
5.1.40.1370.02010.12
5.1.30.1300.02710.51
5.1.20.1600.03010.37
5.1.10.1600.02710.05
5.1.00.1570.03310.04
5.0.50.0330.0338.45
5.0.40.0000.0338.42
5.0.30.0030.0278.34
5.0.20.0000.0338.12
5.0.10.0000.0238.15
5.0.00.0000.0308.08
4.4.90.0030.0138.06
4.4.80.0030.0138.06
4.4.70.0170.0178.06
4.4.60.0630.0178.06
4.4.50.0830.0138.06
4.4.40.0830.0278.06
4.4.30.0630.0178.06
4.4.20.0770.0208.06
4.4.10.0670.0178.06
4.4.00.0730.0238.06
4.3.110.0700.0178.06
4.3.100.0700.0138.06
4.3.90.0830.0238.06
4.3.80.0800.0378.06
4.3.70.0670.0138.06
4.3.60.0500.0338.06
4.3.50.0800.0278.06
4.3.40.0770.0278.06
4.3.30.0470.0278.06
4.3.20.0370.0178.06
4.3.10.0400.0338.06
4.3.00.0330.0208.06