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 = []; foreach ($array as $key => $arr) { foreach ($arr as $k => $v) { $result[$k] = $v; } } var_dump($result);
based on NQL45

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.0100.00316.94
7.2.00.0070.00719.64
7.1.200.0080.00315.93
7.1.100.0130.00717.61
7.1.70.0000.00717.29
7.1.60.0060.01217.38
7.1.50.0090.01216.91
7.1.00.0070.07322.31
7.0.200.0070.01016.80
7.0.140.0000.05021.97
7.0.60.0030.06320.00
7.0.50.0070.07717.89
7.0.40.0130.08320.21
7.0.30.0230.03720.30
7.0.20.0330.06720.19
7.0.10.0230.06020.17
7.0.00.0030.08720.20
5.6.280.0100.06720.92
5.6.210.0070.08320.59
5.6.200.0030.05318.10
5.6.190.0030.08320.28
5.6.180.0330.04320.56
5.6.170.0330.07020.63
5.6.160.0030.06720.41
5.6.150.0030.08018.17
5.6.140.0070.06018.22
5.6.130.0070.05318.17
5.6.120.0030.08320.99
5.6.110.0070.07321.04
5.6.100.0170.06320.98
5.6.90.0070.06020.87
5.6.80.0170.06720.35
5.5.350.0300.07320.35
5.5.340.0130.07717.91
5.5.330.0130.07720.43
5.5.320.0030.04720.32
5.5.310.0370.07020.41
5.5.300.0100.03717.87
5.5.290.0070.07317.98
5.5.280.0070.05020.84
5.5.270.0000.04720.78
5.5.260.0100.07020.93
5.5.250.0100.05020.70
5.5.240.0070.07720.07
5.4.450.0700.07319.57
5.4.440.0800.05719.27
5.4.430.0130.07019.53
5.4.420.0970.07019.59
5.4.410.0870.06019.36
5.4.400.0900.05019.18
5.4.390.0200.04318.56
5.4.380.0070.06318.52
5.4.370.0200.05018.65
5.4.360.0170.05018.60
5.4.350.0030.06718.56
5.4.340.0030.06718.58
5.4.320.0230.05018.77
5.4.310.0230.04318.73
5.4.300.0170.05018.64
5.4.290.0130.05318.68
5.4.280.0030.06318.56
5.4.270.0200.04718.45
5.4.260.0030.06018.51
5.4.250.0200.05018.77
5.4.240.0130.05318.73
5.4.230.0170.05018.76
5.4.220.0200.05318.68
5.4.210.0130.05318.48
5.4.200.0230.05016.51
5.4.190.0170.05318.59
5.4.180.0130.06718.47
5.4.170.0100.06018.44
5.4.160.0200.06318.56
5.4.150.0130.05318.70
5.4.140.0030.06016.16
5.4.130.0130.06316.07
5.4.120.0270.03716.30
5.4.110.0130.06316.36
5.4.100.0170.05016.16
5.4.90.0130.05016.24
5.4.80.0200.04716.20
5.4.70.0130.05316.13
5.4.60.0200.04316.10
5.4.50.0230.06016.28
5.4.40.0130.05316.16
5.4.30.0170.05316.33
5.4.20.0170.06716.23
5.4.10.0230.05016.05
5.4.00.0230.04315.62
5.3.290.0230.05714.74
5.3.280.0170.05714.59
5.3.270.0200.05014.57
5.3.260.0270.04314.70
5.3.250.0300.05714.70
5.3.240.0130.07314.61
5.3.230.0070.07014.67
5.3.220.0100.05714.50
5.3.210.0170.05314.57
5.3.200.0070.06314.55
5.3.190.0170.06314.55
5.3.180.0300.06014.65
5.3.170.0300.04014.59
5.3.160.0130.05314.55
5.3.150.0230.06314.49
5.3.140.0270.05014.52
5.3.130.0270.04714.55
5.3.120.0170.05714.48
5.3.110.0100.05714.55
5.3.100.0070.07014.02
5.3.90.0170.05013.93
5.3.80.0130.05013.95
5.3.70.0100.07314.00
5.3.60.0300.06313.99
5.3.50.0170.04713.92
5.3.40.0200.04714.04
5.3.30.0230.04313.98
5.3.20.0100.05313.78
5.3.10.0070.05313.76
5.3.00.0100.05713.61
5.2.170.0100.04311.12
5.2.160.0070.04311.10
5.2.150.0070.04711.09
5.2.140.0070.05011.14
5.2.130.0170.03711.16
5.2.120.0130.04711.11
5.2.110.0070.04711.09
5.2.100.0100.04711.04
5.2.90.0130.04011.16
5.2.80.0130.05011.10
5.2.70.0330.03711.02
5.2.60.0100.04711.20
5.2.50.0070.04711.05
5.2.40.0130.04010.98
5.2.30.0200.03310.98
5.2.20.0030.04710.94
5.2.10.0070.04310.97
5.2.00.0200.03010.69
5.1.60.0030.04010.01
5.1.50.0130.03010.02
5.1.40.0070.03710.01
5.1.30.0100.04310.39
5.1.20.0130.03710.32
5.1.10.0070.03710.18
5.1.00.0100.03710.22
5.0.50.0030.0308.59
5.0.40.0100.0308.46
5.0.30.0070.0538.25
5.0.20.0030.0308.32
5.0.10.0070.0308.35
5.0.00.0030.0438.18
4.4.90.0030.0235.91
4.4.80.0000.0275.85
4.4.70.0100.0205.84
4.4.60.0000.0275.81
4.4.50.0070.0205.86
4.4.40.0100.0305.87
4.4.30.0070.0305.91
4.4.20.0070.0235.95
4.4.10.0000.0275.93
4.4.00.0030.0475.96
4.3.110.0030.0235.83
4.3.100.0070.0205.83
4.3.90.0070.0275.82
4.3.80.0030.0435.79
4.3.70.0030.0235.77
4.3.60.0000.0275.77
4.3.50.0070.0205.78
4.3.40.0070.0335.76
4.3.30.0030.0234.90
4.3.20.0000.0274.90
4.3.10.0070.0204.90
4.3.00.0330.03014.62