3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { static function bar() { $foo = static function() { return get_called_class(); }; return $foo(); } static function baz() { $foo = function() { return get_called_class(); }; return $foo(); } static function rebind() { $foo = function() { return get_called_class(); }; $oFoo=new Foo; return $foo->bindTo(null,Foo); } } class Bar extends Foo { } //print Bar::bar() . Bar::baz() . print Bar::rebind(); assert(Bar::bar() === 'Bar'); assert(Bar::baz() === 'Bar');

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.0080.00016.64
7.3.00.0040.00816.72
7.2.130.0060.00617.03
7.2.120.0090.00616.99
7.2.110.0060.00817.02
7.2.100.0000.00916.88
7.2.90.0060.00316.88
7.2.80.0070.00417.10
7.2.70.0030.01017.13
7.2.60.0060.00817.00
7.2.50.0030.01017.04
7.2.40.0070.00317.05
7.2.30.0000.00916.80
7.2.20.0030.00716.80
7.2.10.0050.00516.75
7.2.00.0080.00818.14
7.1.250.0040.00815.75
7.1.200.0060.00615.43
7.1.100.0090.00017.92
7.1.70.0060.00316.81
7.1.60.0170.00719.40
7.1.50.0200.01034.79
7.1.00.0000.03722.37
7.0.200.0000.00916.73
7.0.140.0070.07021.99
7.0.60.0070.05719.84
7.0.50.0030.05317.89
7.0.40.0130.04720.09
7.0.30.0570.06720.30
7.0.20.0230.06720.15
7.0.10.0170.04320.18
7.0.00.0230.07020.41
5.6.280.0100.06721.16
5.6.210.0100.07720.56
5.6.200.0030.05318.25
5.6.190.0170.07320.57
5.6.180.0270.07020.35
5.6.170.0200.07020.47
5.6.160.0100.06320.44
5.6.150.0100.06318.18
5.6.140.0130.07718.20
5.6.130.0170.07718.16
5.6.120.0100.06021.04
5.6.110.0100.05021.00
5.6.100.0100.08320.97
5.6.90.0000.09720.98
5.6.80.0200.07020.37
5.6.70.0230.05020.41
5.5.350.0230.05020.40
5.5.340.0100.05017.96
5.5.330.0100.06720.43
5.5.320.0200.06320.28
5.5.310.0300.06320.23
5.5.300.0100.06318.08
5.5.290.0100.04018.08
5.5.280.0070.05720.96
5.5.270.0070.07720.98
5.5.260.0030.08720.65
5.5.250.0070.06720.80
5.5.240.0130.06020.25
5.4.450.0300.05319.55
5.4.440.0170.05019.32
5.4.430.0370.06719.56
5.4.420.0200.04719.48
5.4.410.0200.06319.28
5.4.400.0170.04019.00
5.4.390.0130.06318.87
5.4.380.0200.04719.08
5.4.370.0230.03719.19
5.4.360.0300.03018.98
5.4.350.0170.04718.98
5.4.340.0200.06318.99
5.4.320.0170.03719.31
5.4.310.0230.05319.14
5.4.300.0170.07719.00
5.4.290.0270.07319.14
5.4.280.0230.04319.19
5.4.270.0230.07019.15
5.4.260.0100.04318.85
5.4.250.0170.08018.98
5.4.240.0070.06019.03
5.4.230.0230.07319.07
5.4.220.0130.07319.21
5.4.210.0270.06019.07
5.4.200.0230.03018.93
5.4.190.0170.08018.97
5.4.180.0200.07319.30
5.4.170.0200.06019.05
5.4.160.0200.06019.22
5.4.150.0130.04719.17
5.4.140.0170.06316.52
5.4.130.0230.04316.56
5.4.120.0200.03316.43
5.4.110.0130.07316.52
5.4.100.0170.05316.59
5.4.90.0170.04016.56
5.4.80.0500.04316.44
5.4.70.0200.07016.49
5.4.60.0200.05716.18
5.4.50.0230.05716.48
5.4.40.0270.05716.43
5.4.30.0230.04716.42
5.4.20.0200.04316.26
5.4.10.0230.05316.51
5.4.00.0200.07315.91
5.3.290.0300.07014.71
5.3.280.0270.07014.51
5.3.270.0100.05014.50
5.3.260.0200.07014.52
5.3.250.0170.04014.51
5.3.240.0230.07014.71
5.3.230.0170.04014.71
5.3.220.0200.04714.48
5.3.210.0270.06714.61
5.3.200.0170.07314.57
5.3.190.0330.06314.57
5.3.180.0230.05714.57
5.3.170.0200.07314.61
5.3.160.0200.05714.72
5.3.150.0270.05314.79
5.3.140.0230.06714.65
5.3.130.0130.04314.60
5.3.120.0130.08014.54
5.3.110.0100.04314.47
5.3.100.0170.05714.20
5.3.90.0130.05313.94
5.3.80.0200.06014.14
5.3.70.0270.06014.02
5.3.60.0130.05014.00
5.3.50.0300.06014.10
5.3.40.0130.05014.03
5.3.30.0200.05013.82
5.3.20.0270.03313.74
5.3.10.0200.06713.74
5.3.00.0270.04713.64
5.2.170.0170.04012.13
5.2.160.0130.05712.13
5.2.150.0130.03312.13
5.2.140.0130.03712.13
5.2.130.0170.06712.13
5.2.120.0230.04312.13
5.2.110.0070.05012.13
5.2.100.0230.06012.13
5.2.90.0100.05012.13
5.2.80.0230.03012.13
5.2.70.0130.06012.13
5.2.60.0230.04012.13
5.2.50.0130.06012.13
5.2.40.0100.03312.13
5.2.30.0100.04012.13
5.2.20.0200.05312.13
5.2.10.0100.03712.13
5.2.00.0100.03312.13
5.1.60.0130.02712.13
5.1.50.0200.04712.13
5.1.40.0200.03312.13
5.1.30.0100.03012.13
5.1.20.0070.03012.13
5.1.10.0130.03312.13
5.1.00.0130.03012.13
5.0.50.0030.03312.13
5.0.40.0100.03712.13
5.0.30.0100.06012.13
5.0.20.0100.04312.13
5.0.10.0070.02312.13
5.0.00.0070.06312.13
4.4.90.0070.01712.13
4.4.80.0030.02312.13
4.4.70.0030.03012.13
4.4.60.0030.02312.13
4.4.50.0030.04012.13
4.4.40.0030.04712.13
4.4.30.0030.03712.13
4.4.20.0130.03012.13
4.4.10.0000.04012.13
4.4.00.0000.05312.13
4.3.110.0070.03012.13
4.3.100.0100.02312.13
4.3.90.0130.02712.13
4.3.80.0130.04712.13
4.3.70.0070.03712.13
4.3.60.0100.02312.13
4.3.50.0070.03012.13
4.3.40.0030.04312.13
4.3.30.0030.02712.13
4.3.20.0000.03712.13
4.3.10.0070.03312.13
4.3.00.0030.03712.13