3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = [ 'a' => '1', 'b' => '1', 'c' => '2', ]; $foo2 = array_combine($foo, $foo); var_dump($foo2); $foo3 = array_map(function($v) { return '#' . $v; }, $foo2); var_dump($foo3); $foo4 = array_fill_keys($foo3, $foo); var_dump($foo4);
based on 58riZ

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.0rc40.0280.00798.97
7.3.0rc30.0190.00516.62
7.2.00.0040.00819.41
7.1.100.0040.00817.95
7.1.70.0030.00517.28
7.1.60.0120.00319.40
7.1.50.0110.00717.05
7.1.00.0070.07322.57
7.0.200.0050.00216.75
7.0.140.0000.05322.00
7.0.60.0200.05720.04
7.0.50.0030.04017.96
7.0.40.0000.09720.25
7.0.30.0230.03320.09
7.0.20.0200.04720.12
7.0.10.0100.07020.23
7.0.00.0200.07020.25
5.6.280.0170.05721.08
5.6.210.0070.08020.77
5.6.200.0030.04018.16
5.6.190.0070.08720.41
5.6.180.0200.04020.45
5.6.170.0170.04320.39
5.6.160.0100.06020.47
5.6.150.0130.05318.18
5.6.140.0130.07718.14
5.6.130.0000.06718.15
5.6.120.0000.05720.97
5.6.110.0200.07321.05
5.6.100.0100.08021.01
5.6.90.0170.08320.98
5.6.80.0100.08020.39
5.6.70.4470.04720.43
5.5.350.0230.08320.38
5.5.340.0030.04318.02
5.5.330.0030.04020.27
5.5.320.0330.05320.25
5.5.310.0130.05020.51
5.5.300.0070.08018.09
5.5.290.0000.04317.97
5.5.280.0200.06720.77
5.5.270.0030.04020.67
5.5.260.0100.07720.96
5.5.250.0070.08320.61
5.5.240.0200.03320.19
5.4.450.0800.05319.32
5.4.440.0800.05019.55
5.4.430.0770.05019.63
5.4.420.0170.05019.46
5.4.410.0100.05719.40
5.4.400.0200.07019.23
5.4.390.0200.06319.07
5.4.380.0130.05319.16
5.4.370.0130.06719.21
5.4.360.0170.05719.13
5.4.350.0090.03212.02
5.4.340.0120.04212.02
5.4.320.0030.04512.50
5.4.310.0040.04112.50
5.4.300.0050.04012.51
5.4.290.0060.04112.50
5.4.280.0080.03212.40
5.4.270.0080.03812.39
5.4.260.0090.03712.39
5.4.250.0060.04612.39
5.4.240.0060.03912.39
5.4.230.0060.04112.38
5.4.220.0070.03412.38
5.4.210.0070.03312.39
5.4.200.0050.04612.39
5.4.190.0050.03912.38
5.4.180.0040.04112.38
5.4.170.0070.03812.40
5.4.160.0080.03712.39
5.4.150.0100.03412.38
5.4.140.0080.03712.07
5.4.130.0090.04012.05
5.4.120.0050.03512.01
5.4.110.0060.04112.01
5.4.100.0060.04012.01
5.4.90.0040.03812.01
5.4.80.0040.03812.01
5.4.70.0050.03512.01
5.4.60.0090.03112.01
5.4.50.0030.04112.01
5.4.40.0040.04111.99
5.4.30.0080.03311.99
5.4.20.0060.03411.99
5.4.10.0050.03411.99
5.4.00.0050.03711.48
5.3.290.0070.03812.80
5.3.280.0040.03912.71
5.3.270.0070.04212.72
5.3.260.0100.03412.72
5.3.250.0080.03912.72
5.3.240.0040.03812.72
5.3.230.0030.04012.71
5.3.220.0070.03912.68
5.3.210.0070.03712.68
5.3.200.0060.03712.68
5.3.190.0020.04212.68
5.3.180.0030.03912.67
5.3.170.0090.03312.67
5.3.160.0110.03212.67
5.3.150.0050.03712.67
5.3.140.0050.03612.66
5.3.130.0030.04112.65
5.3.120.0050.03912.66
5.3.110.0070.03712.66
5.3.100.0060.03512.12
5.3.90.0020.03912.08
5.3.80.0070.03412.07
5.3.70.0080.03312.07
5.3.60.0070.03412.06
5.3.50.0090.03312.00
5.3.40.0030.04112.00
5.3.30.0050.03411.95
5.3.20.0060.04111.73
5.3.10.0050.04011.70
5.3.00.0060.03511.68
5.2.170.0040.0309.18
5.2.160.0080.0279.18
5.2.150.0050.0289.18
5.2.140.0060.0279.18
5.2.130.0060.0339.14
5.2.120.0070.0289.14
5.2.110.0030.0309.14
5.2.100.0030.0319.14
5.2.90.0060.0279.14
5.2.80.0050.0309.14
5.2.70.0020.0329.14
5.2.60.0040.0359.09
5.2.50.0040.0309.06
5.2.40.0080.0259.04
5.2.30.0030.0319.01
5.2.20.0080.0349.01
5.2.10.0050.0268.92
5.2.00.0040.0288.78
5.1.60.0040.0238.06
5.1.50.0020.0268.06
5.1.40.0050.0248.05
5.1.30.0010.0288.40
5.1.20.0030.0278.42
5.1.10.0060.0328.14
5.1.00.0040.0258.14
5.0.50.0040.0196.62
5.0.40.0060.0166.48
5.0.30.0050.0296.30
5.0.20.0030.0206.26
5.0.10.0050.0186.24
5.0.00.0030.0316.23
4.4.90.0000.0184.78
4.4.80.0040.0184.76
4.4.70.0030.0154.76
4.4.60.0040.0144.75
4.4.50.0020.0164.77
4.4.40.0010.0274.71
4.4.30.0010.0164.76
4.4.20.0040.0174.85
4.4.10.0050.0154.85
4.4.00.0040.0234.76
4.3.110.0040.0134.67
4.3.100.0020.0164.66
4.3.90.0000.0164.63
4.3.80.0020.0234.58
4.3.70.0020.0154.63
4.3.60.0030.0134.63
4.3.50.0020.0174.63
4.3.40.0030.0234.53
4.3.30.0030.0143.29
4.3.20.0020.0153.26
4.3.10.0030.0143.22
4.3.00.0130.0276.82