3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dataset = array("a" > "one", "b" > "two", "c" => "three"); function foo($a, $b) { return false; } var_dump($dataset, "\n"); foreach($dataset as $key => $val) { $dataset[$key] = foo($val, 'bar'); var_dump($dataset[$key], $key, $val); print(PHP_EOL); } var_dump($dataset); print(PHP_EOL);

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.0070.00719.24
7.1.200.0080.00815.70
7.1.100.0040.00718.34
7.1.70.0000.00916.95
7.1.60.0100.01319.70
7.1.50.0030.01417.01
7.1.00.0000.08022.33
7.0.200.0100.00616.68
7.0.140.0030.07322.21
7.0.60.0070.08320.06
7.0.50.0100.04017.86
7.0.40.0100.07020.26
7.0.30.0300.05020.18
7.0.20.0300.07320.15
7.0.10.0330.05720.19
7.0.00.0170.07320.32
5.6.280.0030.07021.07
5.6.210.0030.04320.48
5.6.200.0030.04718.29
5.6.190.0070.07320.77
5.6.180.0100.05020.46
5.6.170.0300.07320.50
5.6.160.0100.03320.52
5.6.150.0030.08318.18
5.6.140.0100.05718.15
5.6.130.0130.07018.23
5.6.120.0030.08720.99
5.6.110.0170.05021.02
5.6.100.0170.07321.00
5.6.90.0000.08320.99
5.6.80.0000.04020.42
5.6.70.0230.06020.36
5.5.350.0000.05320.43
5.5.340.0170.06717.98
5.5.330.0100.07020.43
5.5.320.0330.06320.20
5.5.310.0170.04320.51
5.5.300.0100.07018.02
5.5.290.0030.07718.05
5.5.280.0030.04320.88
5.5.270.0100.07320.79
5.5.260.0100.07320.73
5.5.250.0070.06320.55
5.5.240.0030.06720.19
5.4.450.0430.04731.27
5.4.440.0170.05031.25
5.4.430.0170.04729.31
5.4.420.0370.04329.29
5.4.410.0200.04729.29
5.4.400.0200.04329.25
5.4.390.0630.04028.69
5.4.380.0200.04718.73
5.4.370.0200.04718.75
5.4.360.0270.04718.74
5.4.350.0070.06018.66
5.4.340.0170.05018.73
5.4.320.0060.03612.50
5.4.310.0060.04312.50
5.4.300.0050.04412.51
5.4.290.0050.04012.50
5.4.280.0070.03512.40
5.4.270.0040.03812.40
5.4.260.0070.03712.40
5.4.250.0040.04312.40
5.4.240.0100.03512.40
5.4.230.0060.04012.39
5.4.220.0080.03612.39
5.4.210.0050.03612.39
5.4.200.0100.03712.39
5.4.190.0060.03912.39
5.4.180.0060.03812.39
5.4.170.0090.03412.39
5.4.160.0060.03812.39
5.4.150.0060.04212.39
5.4.140.0060.03912.07
5.4.130.0120.03512.05
5.4.120.0080.04312.02
5.4.110.0060.04312.01
5.4.100.0050.03612.02
5.4.90.0050.03912.01
5.4.80.0070.03712.01
5.4.70.0070.03612.00
5.4.60.0070.03412.01
5.4.50.0060.03612.01
5.4.40.0060.03512.00
5.4.30.0060.03511.99
5.4.20.0060.03511.99
5.4.10.0080.03212.00
5.4.00.0060.04311.48
5.3.290.0080.03712.80
5.3.280.0070.03812.71
5.3.270.0070.03912.73
5.3.260.0110.05612.72
5.3.250.0060.04312.72
5.3.240.0090.03512.72
5.3.230.0080.03612.71
5.3.220.0050.04012.68
5.3.210.0060.03912.68
5.3.200.0060.03712.68
5.3.190.0040.04012.67
5.3.180.0070.03612.67
5.3.170.0110.03412.67
5.3.160.0090.03412.67
5.3.150.0060.03712.68
5.3.140.0050.03812.66
5.3.130.0080.03712.66
5.3.120.0100.03612.66
5.3.110.0070.03812.66
5.3.100.0070.03712.12
5.3.90.0050.03712.09
5.3.80.0060.03812.09
5.3.70.0060.03612.09
5.3.60.0080.03512.08
5.3.50.0090.03512.02
5.3.40.0070.03712.02
5.3.30.0020.03911.98
5.3.20.0050.03711.76
5.3.10.0050.03811.72
5.3.00.0030.04311.72
5.2.170.0040.0329.21
5.2.160.0040.0309.21
5.2.150.0050.0319.21
5.2.140.0070.0289.21
5.2.130.0060.0289.18
5.2.120.0050.0309.17
5.2.110.0050.0299.18
5.2.100.0020.0329.18
5.2.90.0060.0299.17
5.2.80.0050.0309.17
5.2.70.0020.0339.17
5.2.60.0060.0319.13
5.2.50.0030.0339.10
5.2.40.0020.0319.07
5.2.30.0050.0309.04
5.2.20.0060.0279.03
5.2.10.0070.0268.94
5.2.00.0030.0328.80
5.1.60.0090.0278.09
5.1.50.0040.0278.09
5.1.40.0080.0278.06
5.1.30.0070.0338.41
5.1.20.0060.0258.44
5.1.10.0050.0278.16
5.1.00.0040.0298.16
5.0.50.0070.0196.64
5.0.40.0020.0236.50
5.0.30.0030.0336.31
5.0.20.0030.0206.28
5.0.10.0040.0206.26
5.0.00.0030.0326.25
4.4.90.0040.0144.78
4.4.80.0040.0144.75
4.4.70.0000.0184.75
4.4.60.0060.0124.75
4.4.50.0040.0144.77
4.4.40.0020.0264.71
4.4.30.0020.0164.76
4.4.20.0030.0154.84
4.4.10.0020.0174.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0000.0184.66
4.3.90.0010.0164.63
4.3.80.0040.0234.58
4.3.70.0040.0144.63
4.3.60.0020.0154.63
4.3.50.0040.0144.63
4.3.40.0020.0254.54
4.3.30.0010.0173.31
4.3.20.0020.0163.29
4.3.10.0010.0173.25
4.3.00.0000.02026.75