3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [ 1 => [ 1 => [ 'anna', 'alice' ], 2 => [ 'bob', 'bartold' ] ], 2 => [ 1 => [ 'carol' ], 2 => [ 'david' ] ] ]; $result = []; $prevKey = 0; array_walk_recursive($array, function ($value, $key) use (&$result, &$prevKey) { if (!is_array($value)) { }else { $prevKey = $key; echo $prevKey; } }); var_dump($result);
based on 2WEpY

Here you find the average performance (time & memory) of each version. A greyed 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.0alpha10.0060.00012.70
7.2.60.0080.00416.78
7.2.00.0100.00719.56
7.1.100.0030.00918.15
7.1.70.0000.01017.22
7.1.60.0170.00719.46
7.1.50.0100.01316.90
7.1.00.0070.07322.33
7.0.200.0040.00416.73
7.0.140.0030.03322.13
7.0.60.0070.04319.91
7.0.50.0030.06017.87
7.0.40.0130.07720.18
7.0.30.0070.08020.25
7.0.20.0230.07720.19
7.0.10.0070.04720.12
7.0.00.0070.04720.38
5.6.280.0030.07320.89
5.6.210.0030.05720.52
5.6.200.0130.07318.29
5.6.190.0100.08320.61
5.6.180.0270.04720.51
5.6.170.0270.07320.57
5.6.160.0100.07320.50
5.6.150.0030.08718.19
5.6.140.0000.06018.21
5.6.130.0130.04018.17
5.6.120.0130.06321.02
5.6.110.0070.06721.14
5.6.100.0170.07721.00
5.6.90.0070.07721.02
5.6.80.0030.05720.37
5.5.350.3970.04720.33
5.5.340.0130.05317.92
5.5.330.0070.06720.40
5.5.320.0230.03320.37
5.5.310.0370.08020.48
5.5.300.0070.07318.07
5.5.290.0070.04318.03
5.5.280.0070.05720.73
5.5.270.0030.04720.68
5.5.260.0030.06320.82
5.5.250.0100.07720.69
5.5.240.0270.06020.29
5.4.450.0230.07019.28
5.4.440.0230.05719.41
5.4.430.0200.07719.41
5.4.420.0200.04319.41
5.4.410.0270.06719.19
5.4.400.0200.05019.20
5.4.390.0170.04019.20
5.4.380.0200.07319.20
5.4.370.0200.04718.97
5.4.360.0270.07318.98
5.4.350.0200.05719.22
5.4.340.0270.07019.24
5.4.320.0200.04719.08
5.4.310.0300.06719.31
5.4.300.0330.07019.17
5.4.290.0370.03719.15
5.4.280.0270.07019.14
5.4.270.0300.05319.08
5.4.260.0270.06719.22
5.4.250.0230.03719.05
5.4.240.0300.06318.95
5.4.230.0230.07019.21
5.4.220.0200.05019.22
5.4.210.0300.05719.03
5.4.200.0300.06719.08
5.4.190.0330.07018.86
5.4.180.0300.06718.99
5.4.170.0300.06319.16
5.4.160.0300.07018.82
5.4.150.0270.06319.20
5.4.140.0230.03716.50
5.4.130.0200.03716.50
5.4.120.0230.03716.50
5.4.110.0300.06316.56
5.4.100.0330.06316.20
5.4.90.0270.06016.19
5.4.80.0300.05016.53
5.4.70.0170.04316.54
5.4.60.0230.03316.17
5.4.50.0270.06716.23
5.4.40.0170.04016.38
5.4.30.0300.03716.52
5.4.20.0200.03316.42
5.4.10.0230.04316.32
5.4.00.0270.03015.79
5.3.290.0170.04014.51
5.3.280.0230.04314.46
5.3.270.0200.03714.45
5.3.260.0130.04014.55
5.3.250.0170.03314.56
5.3.240.0200.03314.70
5.3.230.0200.03714.45
5.3.220.0170.03714.55
5.3.210.0170.04014.52
5.3.200.0170.03714.52
5.3.190.0170.03714.51
5.3.180.0300.05714.42
5.3.170.0170.04014.44
5.3.160.0170.03714.66
5.3.150.0200.03714.52
5.3.140.0100.04014.39
5.3.130.0130.04014.56
5.3.120.0170.03714.50
5.3.110.0170.03714.41
5.3.100.0130.04013.88
5.3.90.0170.03713.89
5.3.80.0200.04014.00
5.3.70.0200.03713.79
5.3.60.0130.04014.05
5.3.50.0200.04013.96
5.3.40.0170.04713.82
5.3.30.0170.03313.75
5.3.20.0270.03713.57
5.3.10.0130.04013.45
5.3.00.0230.02713.58
5.2.170.0130.03013.04
5.2.160.0170.02713.04
5.2.150.0200.02313.04
5.2.140.0130.03013.04
5.2.130.0130.03013.04
5.2.120.0100.03313.04
5.2.110.0130.02713.04
5.2.100.0130.02713.04
5.2.90.0100.03313.04
5.2.80.0130.03013.04
5.2.70.0130.03013.04
5.2.60.0100.03313.04
5.2.50.0200.02013.04
5.2.40.0130.02713.04
5.2.30.0100.03013.04
5.2.20.0130.02313.04
5.2.10.0100.03013.04
5.2.00.0030.03313.04
5.1.60.0100.02313.04
5.1.50.0130.02013.04
5.1.40.0130.02013.04
5.1.30.0170.02013.04
5.1.20.0170.02013.04
5.1.10.0100.02713.04
5.1.00.0100.02313.04
5.0.50.0000.02313.04
5.0.40.0070.01713.04
5.0.30.0100.02713.04
5.0.20.0000.02013.04
5.0.10.0070.02313.04
5.0.00.0030.03013.04
4.4.90.0030.01713.04
4.4.80.0070.01313.04
4.4.70.0000.01713.04
4.4.60.0100.00713.04
4.4.50.0070.01313.04
4.4.40.0170.02013.04
4.4.30.0030.01313.04
4.4.20.0000.01713.04
4.4.10.0130.01013.04
4.4.00.0070.02313.04
4.3.110.0030.01713.04
4.3.100.0070.01313.04
4.3.90.0070.01313.04
4.3.80.0070.02713.04
4.3.70.0030.01713.04
4.3.60.0070.01313.04
4.3.50.0070.01313.04
4.3.40.0070.02713.04
4.3.30.0030.01713.04
4.3.20.0000.01713.04
4.3.10.0030.01713.04
4.3.00.0030.01713.04