3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C { private $myCodeCapsule; public function store($context) { $this->myCodeCapsule = $context; } public function execute() { $this->myCodeCapsule->__invoke(); } } $obj = new C; $x = null; $obj->store(function () use (&$x) { $x = 1; }); $x=0; $obj->execute(); var_dump($x);
based on GD1hU

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.0120.00416.77
7.2.00.0040.01219.21
7.1.200.0000.01315.80
7.1.100.0060.00618.07
7.1.70.0000.01016.93
7.1.60.0090.01519.50
7.1.50.0090.01617.14
7.1.00.0100.07022.36
7.0.200.0260.01014.44
7.0.140.0070.07321.98
7.0.60.0070.07319.95
7.0.50.0070.05017.83
7.0.40.0100.04020.25
7.0.30.0270.06020.15
7.0.20.0230.08720.15
7.0.10.0300.07720.21
7.0.00.0100.08020.24
5.6.280.0100.06320.90
5.6.210.0070.04020.55
5.6.200.0100.06318.16
5.6.190.0100.08720.57
5.6.180.0270.05720.39
5.6.170.0370.06020.50
5.6.160.0070.04020.48
5.6.150.0100.03318.25
5.6.140.0100.05718.16
5.6.130.0000.04718.32
5.6.120.0000.05720.90
5.6.110.0100.07021.12
5.6.100.0030.09021.02
5.6.90.0030.04020.99
5.6.80.0100.06020.40
5.6.70.0100.03720.42
5.5.350.0200.03320.38
5.5.340.0030.08317.95
5.5.330.0100.07320.36
5.5.320.0000.05020.43
5.5.310.0300.03720.34
5.5.300.0130.07018.04
5.5.290.0030.04317.95
5.5.280.0070.07720.80
5.5.270.0070.04320.77
5.5.260.0070.04320.97
5.5.250.0170.07320.47
5.5.240.0030.04720.37
5.4.450.0200.06019.46
5.4.440.0770.07019.55
5.4.430.0100.06019.43
5.4.420.0670.07319.43
5.4.410.0070.05719.03
5.4.400.0430.05018.67
5.4.390.0370.04718.63
5.4.380.0300.06018.63
5.4.370.0270.05718.76
5.4.360.0330.05018.84
5.4.350.0170.06718.48
5.4.340.0470.06718.61
5.4.320.0400.07318.59
5.4.310.0470.07018.61
5.4.300.0400.06718.74
5.4.290.0330.06018.61
5.4.280.0330.06318.54
5.4.270.0530.06018.76
5.4.260.0430.05718.77
5.4.250.0470.06718.78
5.4.240.0500.05318.84
5.4.230.0430.06718.81
5.4.220.0330.06018.52
5.4.210.0330.06718.75
5.4.200.0370.04716.54
5.4.190.0400.07718.52
5.4.180.0370.07318.79
5.4.170.0170.07718.77
5.4.160.0130.07718.51
5.4.150.0530.05318.81
5.4.140.0470.06016.34
5.4.130.0300.07016.20
5.4.120.0300.06016.29
5.4.110.0430.05716.23
5.4.100.0630.07016.25
5.4.90.0470.07316.33
5.4.80.0400.07316.42
5.4.70.0300.07716.42
5.4.60.0370.07316.31
5.4.50.0400.05316.24
5.4.40.0470.07716.25
5.4.30.0330.07316.26
5.4.20.0370.06716.14
5.4.10.0530.06016.26
5.4.00.0400.06715.64
5.3.290.0530.07314.69
5.3.280.0700.04714.74
5.3.270.0370.07714.81
5.3.260.0570.06014.65
5.3.250.0500.06314.83
5.3.240.0370.07314.71
5.3.230.0630.06714.60
5.3.220.0600.05314.63
5.3.210.0370.07714.59
5.3.200.0500.06714.59
5.3.190.0470.06714.60
5.3.180.0500.06014.70
5.3.170.0500.06314.75
5.3.160.0430.06714.59
5.3.150.0500.07014.79
5.3.140.0570.05714.59
5.3.130.0430.07314.68
5.3.120.0430.07714.75
5.3.110.0600.07314.73
5.3.100.0400.06314.10
5.3.90.0400.06714.15
5.3.80.0330.07014.14
5.3.70.0430.05714.04
5.3.60.0400.06714.07
5.3.50.0330.05713.95
5.3.40.0400.06314.03
5.3.30.0370.05013.97
5.3.20.0470.06013.73
5.3.10.0530.05313.71
5.3.00.0330.05313.64
5.2.170.0370.05011.16
5.2.160.0330.04711.14
5.2.150.0500.05311.28
5.2.140.0430.04711.25
5.2.130.0330.06311.16
5.2.120.0330.05011.32
5.2.110.0330.05311.16
5.2.100.0500.02711.15
5.2.90.0200.04711.15
5.2.80.0200.06011.15
5.2.70.0270.05711.13
5.2.60.0230.05711.27
5.2.50.0330.04711.04
5.2.40.0100.05711.02
5.2.30.0300.03710.98
5.2.20.0130.04711.09
5.2.10.0230.04311.09
5.2.00.0330.04010.77
5.1.60.0230.04010.06
5.1.50.0270.04710.02
5.1.40.0370.03710.10
5.1.30.0200.05310.44
5.1.20.0200.05310.42
5.1.10.0170.03710.15
5.1.00.0300.03310.11
5.0.50.0170.0338.69
5.0.40.0170.0338.50
5.0.30.0100.0608.36
5.0.20.0100.0408.27
5.0.10.0170.0208.38
5.0.00.0170.0338.35
4.4.90.0130.0275.90
4.4.80.0170.0305.90
4.4.70.0130.0305.98
4.4.60.0070.0335.93
4.4.50.0170.0275.90
4.4.40.0130.0475.89
4.4.30.0230.0235.92
4.4.20.0070.0235.97
4.4.10.0130.0275.98
4.4.00.0130.0305.91
4.3.110.0200.0205.81
4.3.100.0030.0305.79
4.3.90.0070.0235.79
4.3.80.0070.0375.79
4.3.70.0070.0235.76
4.3.60.0100.0235.82
4.3.50.0170.0275.89
4.3.40.0130.0335.78
4.3.30.0170.0274.58
4.3.20.0070.0274.52
4.3.10.0070.0274.57
4.3.00.0100.0206.51