3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { private $secret = 'Nyy lbhe Onfr ner orybat gb hf.'; private $callback; final public function run() { call_user_func($this->callback); return $this->secret . PHP_EOL; } public function __set($k, $v) { $key = $v[($v[$v])]; // $v is some kind of weird array $value = $v(); // and a callback! $this->{$key} = $value; } } $test = new Test; // start editing here $cl1 = static function() { return $this->secret; }; $a = array('test','run'); Closure::bind($cl1, null, $test); $test->secret = $a; // end editing here echo $test->run();

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.80.0000.00816.61
7.2.60.0060.00916.78
7.2.00.0060.01219.28
7.1.200.0030.00815.85
7.1.100.0000.01218.20
7.1.70.0000.00816.90
7.1.60.0070.01419.82
7.1.50.0090.01616.96
7.1.00.0030.07722.28
7.0.200.0100.00016.73
7.0.140.0000.07721.98
7.0.100.0230.08019.95
7.0.90.0270.07019.90
7.0.80.0030.08020.01
7.0.70.0100.04319.87
7.0.60.0270.07019.88
7.0.50.0070.03720.31
7.0.40.0000.08320.00
7.0.30.0030.04720.02
7.0.20.0100.06720.14
7.0.10.0100.03720.09
7.0.00.0130.05020.13
5.6.280.0070.07020.82
5.6.250.0100.08720.58
5.6.240.0130.07020.59
5.6.230.0100.08320.73
5.6.220.0100.04320.68
5.6.210.0070.09720.57
5.6.200.0070.04721.09
5.6.190.0100.08021.09
5.6.180.0000.08321.02
5.6.170.0070.08321.05
5.6.160.0030.04321.05
5.6.150.0100.05321.13
5.6.140.0070.06321.13
5.6.130.0100.07321.05
5.6.120.0030.08721.08
5.6.110.0030.09321.08
5.6.100.0130.07321.10
5.6.90.0100.08320.94
5.6.80.0100.08020.50
5.6.70.0070.06020.41
5.6.60.0070.04320.31
5.6.50.0170.07320.36
5.6.40.0070.07720.50
5.6.30.0170.06020.36
5.6.20.0100.06020.29
5.6.10.0070.06320.36
5.6.00.0030.04020.35
5.5.380.0070.08020.41
5.5.370.0100.05020.49
5.5.360.0200.03720.37
5.5.350.0070.04020.40
5.5.340.0070.04020.93
5.5.330.0130.06320.76
5.5.320.0070.05320.78
5.5.310.0100.04720.93
5.5.300.0070.08320.88
5.5.290.0100.05020.88
5.5.280.0030.08020.89
5.5.270.0100.08720.65
5.5.260.0130.07020.73
5.5.250.0100.09020.70
5.5.240.0230.05320.13
5.5.230.0100.07720.12
5.5.220.0130.05720.28
5.5.210.0000.08020.13
5.5.200.0000.06320.13
5.5.190.0130.04020.27
5.5.180.0100.05020.24
5.5.160.0030.05020.13
5.5.150.0130.07020.24
5.5.140.0030.07720.27
5.5.130.0170.07320.15
5.5.120.0070.07720.13
5.5.110.0030.05320.26
5.5.100.0030.08320.09
5.5.90.0100.07720.16
5.5.80.0130.03319.98
5.5.70.0130.06720.05
5.5.60.0030.05320.13
5.5.50.0200.05319.95
5.5.40.0130.05320.05
5.5.30.0000.05720.06
5.5.20.0100.06020.05
5.5.10.0000.06720.09
5.5.00.0100.06320.05
5.4.450.0100.04019.29
5.4.440.0130.07019.45
5.4.430.0100.08319.17
5.4.420.0100.07019.52
5.4.410.0130.03719.26
5.4.400.0100.04719.21
5.4.390.0130.06718.90
5.4.380.0030.08319.23
5.4.370.0130.05719.04
5.4.360.0030.05018.85
5.4.350.0030.04318.88
5.4.340.0130.07018.88
5.4.320.0130.03318.91
5.4.310.0030.03719.05
5.4.300.0100.04319.02
5.4.290.0130.07018.89
5.4.280.0000.04719.02
5.4.270.0100.07019.04
5.4.260.0030.07018.90
5.4.250.0130.05718.94
5.4.240.0030.06718.84
5.4.230.0030.04019.08
5.4.220.0100.03719.04
5.4.210.0030.06719.04
5.4.200.0030.08319.17
5.4.190.0130.07319.11
5.4.180.0070.04319.17
5.4.170.0170.06718.94
5.4.160.0100.07019.13
5.4.150.0100.07319.02
5.4.140.0070.04316.50
5.4.130.0030.07316.36
5.4.120.0130.03016.14
5.4.110.0070.07016.34
5.4.100.0070.03716.36
5.4.90.0070.03316.32
5.4.80.0070.06716.41
5.4.70.0070.06016.48
5.4.60.0100.05716.37
5.4.50.0100.06716.51
5.4.40.0070.06316.54
5.4.30.0100.06016.41
5.4.20.0070.03716.40
5.4.10.0070.05316.30
5.4.00.0100.03715.82
5.3.290.0100.05014.78
5.3.280.0100.06714.73
5.3.270.0100.05314.64
5.3.260.0030.07014.59
5.3.250.0130.07314.60
5.3.240.0070.06714.68
5.3.230.0000.04314.66
5.3.220.0030.06014.58
5.3.210.0230.02714.68
5.3.200.0070.04014.58
5.3.190.0030.05714.64
5.3.180.0100.04014.60
5.3.170.0070.05014.71
5.3.160.0100.07314.55
5.3.150.0070.06314.60
5.3.140.0170.06314.49
5.3.130.0200.05714.52
5.3.120.0000.08314.54
5.3.110.0100.07314.56
5.3.100.0100.06713.96
5.3.90.0030.07714.04
5.3.80.0070.08014.11
5.3.70.0100.03713.91
5.3.60.0100.06313.93
5.3.50.0070.06713.88
5.3.40.0070.04713.93
5.3.30.0130.05314.03
5.3.20.0030.05313.70
5.3.10.0070.03713.72
5.3.00.0000.04013.73
5.2.170.0100.05311.25
5.2.160.0070.04711.18
5.2.150.0030.06011.02
5.2.140.0000.03711.06
5.2.130.0000.05310.99
5.2.120.0100.02711.11
5.2.110.0030.04011.13
5.2.100.0070.06711.02
5.2.90.0000.06011.24
5.2.80.0100.02711.10
5.2.70.0000.03311.21
5.2.60.0000.03711.11
5.2.50.0030.03011.01
5.2.40.0070.02310.91
5.2.30.0030.03010.88
5.2.20.0000.03310.88
5.2.10.0070.02310.93
5.2.00.0000.03010.67
5.1.60.0030.02010.06
5.1.50.0000.0239.85
5.1.40.0070.02010.09
5.1.30.0100.02010.46
5.1.20.0030.03010.31
5.1.10.0000.0279.92
5.1.00.0000.0279.96
5.0.50.0030.0208.56
5.0.40.0000.0208.45
5.0.30.0000.0338.22
5.0.20.0000.0178.20
5.0.10.0000.0178.04
5.0.00.0070.0608.16
4.4.90.0030.0137.94
4.4.80.0000.0177.94
4.4.70.0000.0177.94
4.4.60.0000.0177.94
4.4.50.0000.0137.94
4.4.40.0030.0237.94
4.4.30.0000.0177.94
4.4.20.0000.0177.94
4.4.10.0000.0177.94
4.4.00.0000.0277.94
4.3.110.0030.0137.94
4.3.100.0000.0377.94
4.3.90.0000.0277.94
4.3.80.0030.0407.94
4.3.70.0000.0237.94
4.3.60.0070.0307.94
4.3.50.0000.0177.94
4.3.40.0070.0477.94
4.3.30.0000.0207.94
4.3.20.0000.0177.94
4.3.10.0030.0307.94
4.3.00.0000.0177.94