3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function create_function2($args, $content) { static $counter = 0; $funcname = "lambda_" . (++$counter); eval("function $funcname ({$args}) { {$content}; }"); return $funcname; } $func1 = create_function('$a,$b', 'return $a.$b;'); $func2 = create_function2('$a,$b', 'return $a.$b;'); $rs1 = $func1(1, 2); $rs2 = $func2(1, 2); var_dump($func1, $rs1); var_dump($func2, $rs2);

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.10.0110.00616.41
7.3.00.0180.00316.55
7.2.130.0100.00916.72
7.2.120.0030.01316.62
7.2.110.0080.00716.47
7.2.100.0090.00716.73
7.2.90.0080.00616.78
7.2.80.0070.00816.66
7.2.70.0110.00916.92
7.2.60.0030.00916.66
7.2.50.0110.00716.84
7.2.40.0120.00316.50
7.2.30.0150.00316.75
7.2.20.0130.00716.67
7.2.10.0080.01016.58
7.2.00.0090.00717.40
7.1.250.0090.00615.42
7.1.200.0050.00515.94
7.1.100.0090.00617.87
7.1.70.0070.00017.28
7.1.60.0070.01719.17
7.1.50.0070.01816.97
7.1.00.0100.07322.30
7.0.200.0040.00416.79
7.0.140.0000.07022.08
7.0.100.0070.07719.93
7.0.90.0100.07019.90
7.0.80.0130.06320.16
7.0.70.0100.03319.87
7.0.60.0030.08320.06
7.0.50.0100.08020.32
7.0.40.0070.07720.05
7.0.30.0070.08020.07
7.0.20.0130.08020.07
7.0.10.0030.08020.12
7.0.00.0130.04720.13
5.6.280.0030.07321.12
5.6.250.0100.06720.64
5.6.240.0070.08020.61
5.6.230.0070.07020.69
5.6.220.0100.06320.71
5.6.210.0100.07020.57
5.6.200.0000.08721.13
5.6.190.0030.08321.11
5.6.180.0100.05021.04
5.6.170.0070.07721.09
5.6.160.0130.07321.11
5.6.150.0070.07721.00
5.6.140.0070.08320.92
5.6.130.0100.06721.11
5.6.120.0030.08321.03
5.6.110.0100.07721.06
5.6.100.0170.07320.96
5.6.90.0030.09021.03
5.6.80.0070.08020.57
5.6.70.0130.07320.43
5.6.60.0100.07320.43
5.6.50.0170.07020.57
5.6.40.0200.07020.37
5.6.30.0170.06720.45
5.6.20.0230.04720.49
5.6.10.0000.06320.53
5.6.00.0170.07320.42
5.5.380.0070.07020.52
5.5.370.0100.07720.43
5.5.360.0070.08320.49
5.5.350.0130.07320.42
5.5.340.0070.07720.94
5.5.330.0070.07020.80
5.5.320.0230.04020.84
5.5.310.0170.07320.89
5.5.300.0070.08020.87
5.5.290.0170.07020.84
5.5.280.0030.09320.75
5.5.270.0130.07320.91
5.5.260.0100.04720.89
5.5.250.0130.07720.72
5.5.240.0070.08020.12
5.5.230.0130.07720.30
5.5.220.0100.07020.30
5.5.210.0070.07020.24
5.5.200.0070.07719.96
5.5.190.0130.07020.09
5.5.180.0170.06320.24
5.5.160.0070.08020.28
5.5.150.0030.06720.28
5.5.140.0130.07320.29
5.5.130.0070.08020.16
5.5.120.0170.07020.18
5.5.110.0030.08020.24
5.5.100.0070.07020.14
5.5.90.0070.07720.07
5.5.80.0070.05720.07
5.5.70.0070.08019.97
5.5.60.0070.07719.96
5.5.50.0070.04720.06
5.5.40.0130.07320.10
5.5.30.0170.06320.03
5.5.20.0070.05020.16
5.5.10.0100.07320.12
5.5.00.0100.07720.11
5.4.450.0070.08019.45
5.4.440.0100.08019.36
5.4.430.0070.08019.44
5.4.420.0030.07719.36
5.4.410.0100.07719.37
5.4.400.0100.07319.13
5.4.390.0230.06018.85
5.4.380.0130.07319.14
5.4.370.0100.07019.16
5.4.360.0130.07319.14
5.4.350.0070.07719.23
5.4.340.0070.08019.26
5.4.320.0100.07318.95
5.4.310.0000.08319.24
5.4.300.0030.06318.95
5.4.290.0100.05718.82
5.4.280.0100.07719.16
5.4.270.0070.08018.85
5.4.260.0070.07319.09
5.4.250.0070.07018.90
5.4.240.0100.07319.14
5.4.230.0030.07319.04
5.4.220.0030.08019.15
5.4.210.0070.07719.13
5.4.200.0030.08319.20
5.4.190.0030.08019.20
5.4.180.0130.07018.89
5.4.170.0100.07019.06
5.4.160.0070.07719.03
5.4.150.0100.07019.02
5.4.140.0200.06016.46
5.4.130.0130.06016.45
5.4.120.0100.04016.43
5.4.110.0130.07316.45
5.4.100.0170.06316.45
5.4.90.0230.05716.48
5.4.80.0100.06316.43
5.4.70.0000.07316.37
5.4.60.0030.05716.50
5.4.50.0070.07316.46
5.4.40.0070.07016.49
5.4.30.0070.07316.29
5.4.20.0070.07316.40
5.4.10.0100.07016.40
5.4.00.0130.06715.79
5.3.290.0030.06714.70
5.3.280.0030.08014.72
5.3.270.0230.05714.63
5.3.260.0130.04014.60
5.3.250.0100.07014.57
5.3.240.0030.04714.74
5.3.230.0100.07014.59
5.3.220.0030.07714.69
5.3.210.0070.07314.59
5.3.200.0170.04314.65
5.3.190.0030.07714.61
5.3.180.0070.07314.67
5.3.170.0000.05014.64
5.3.160.0030.08014.56
5.3.150.0030.06714.52
5.3.140.0000.08714.58
5.3.130.0070.07314.59
5.3.120.0030.08014.59
5.3.110.0070.07314.70
5.3.100.0000.08014.11
5.3.90.0100.04014.06
5.3.80.0070.07713.93
5.3.70.0130.06314.07
5.3.60.0100.07014.05
5.3.50.0130.06314.05
5.3.40.0030.08014.10
5.3.30.0070.07013.93
5.3.20.0100.03313.62
5.3.10.0100.06013.69
5.3.00.0070.07013.67
5.2.170.0000.05311.07
5.2.160.0030.04711.23
5.2.150.0100.03311.17
5.2.140.0070.04311.20
5.2.130.0130.05011.12
5.2.120.0030.06311.16
5.2.110.0070.06011.13
5.2.100.0070.03311.13
5.2.90.0000.06011.14
5.2.80.0000.06311.17
5.2.70.0100.05011.00
5.2.60.0000.05311.21
5.2.50.0000.06711.17
5.2.40.0030.04310.88
5.2.30.0100.05311.05
5.2.20.0030.05311.03
5.2.10.0100.05311.02
5.2.00.0000.06710.87
5.1.60.0030.05310.11
5.1.50.0030.05710.11
5.1.40.0030.05710.09
5.1.30.0070.03710.47
5.1.20.0070.03310.30
5.1.10.0000.06010.09
5.1.00.0070.05010.09
5.0.50.0030.0479.63
5.0.40.0000.0479.63
5.0.30.0030.0439.63
5.0.20.0030.0409.63
5.0.10.0070.0479.63
5.0.00.0100.0439.63
4.4.90.0000.0239.63
4.4.80.0030.0339.63
4.4.70.0070.0339.63
4.4.60.0030.0379.63
4.4.50.0070.0339.63
4.4.40.0030.0539.63
4.4.30.0000.0409.63
4.4.20.0030.0379.63
4.4.10.0030.0339.63
4.4.00.0030.0539.63
4.3.110.0030.0339.63
4.3.100.0000.0309.63
4.3.90.0070.0339.63
4.3.80.0070.0309.63
4.3.70.0100.0179.63
4.3.60.0030.0339.63
4.3.50.0070.0339.63
4.3.40.0000.0579.63
4.3.30.0000.0279.63
4.3.20.0000.0409.63
4.3.10.0000.0379.63
4.3.00.0000.0279.63