3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $bla = ''; public function __construct(){ $this->bla = "fooooo"; } public function __invoke($arg){ $this->bla = $arg + $this->bla; } } Class Foo2 extends Foo { } $blubb = new Foo2(); $blubb("bl0a"); var_dump($blubb);
based on kffRu

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.0030.01116.79
7.2.00.0100.00319.20
7.1.200.0080.00015.68
7.1.100.0070.01518.18
7.1.70.0030.00617.31
7.1.60.0200.00319.40
7.1.50.0070.01016.60
7.1.00.0070.07322.45
7.0.200.0830.00314.78
7.0.60.0130.05321.73
7.0.50.0130.07317.86
7.0.40.0100.09020.14
7.0.30.0300.04720.13
7.0.20.0230.08720.07
7.0.10.0070.08320.09
7.0.00.0070.08320.08
5.6.210.0170.05020.65
5.6.200.0100.07318.19
5.6.190.0100.07020.34
5.6.180.0470.05320.63
5.6.170.0370.07720.55
5.6.160.0070.04020.46
5.6.150.0130.07718.18
5.6.140.0000.05018.15
5.6.130.0030.08718.28
5.6.120.0070.04021.13
5.6.110.0030.07320.98
5.6.100.0070.09020.98
5.6.90.0030.05720.88
5.6.80.0030.08320.47
5.5.350.0100.08020.42
5.5.340.0070.05717.95
5.5.330.0130.07720.57
5.5.320.0600.06720.28
5.5.310.0270.04320.41
5.5.300.0030.04017.92
5.5.290.0070.08017.92
5.5.280.0100.05720.97
5.5.270.0170.07320.82
5.5.260.0070.08020.84
5.5.250.0070.03720.59
5.5.240.0130.08320.16
5.4.450.1030.05319.54
5.4.440.0900.06019.51
5.4.430.1000.05019.60
5.4.420.0900.06019.55
5.4.410.0830.06319.42
5.4.400.0800.05319.27
5.4.390.0730.06019.10
5.4.380.0630.06719.18
5.4.370.0470.05019.31
5.4.360.0670.06319.23
5.4.350.0700.06019.27
5.4.340.0700.06018.94
5.4.320.0630.06019.18
5.4.310.0930.04719.20
5.4.300.0730.06319.21
5.4.290.0670.07019.27
5.4.280.0570.07019.09
5.4.270.0670.05319.30
5.4.260.0470.05319.30
5.4.250.0730.04719.16
5.4.240.0930.06019.27
5.4.230.0700.06019.21
5.4.220.0930.05719.30
5.4.210.0870.05319.18
5.4.200.0830.05719.17
5.4.190.0900.07019.11
5.4.180.1070.05319.15
5.4.170.1000.05319.16
5.4.160.1070.05018.92
5.4.150.1000.05719.18
5.4.140.0870.05316.43
5.4.130.0700.05716.59
5.4.120.0800.06016.46
5.4.110.0830.06316.69
5.3.290.0700.05014.58
5.3.280.0400.06014.55
5.3.270.1070.05714.60
5.3.260.0730.05714.56
5.3.250.1030.05014.64
5.3.240.0930.05714.61
5.3.230.1230.04314.55
5.3.220.0770.05014.53
5.3.210.1170.04714.54