3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $class_aliases = [ 'FooAlias' => 'Foo' ]; spl_autoload_register(function($class) { if (isset($class_aliases[$class])) { class_alias($class_aliases[$class], $class); var_dump($class); return true; } }); class Foo {} class Bar extends Foo {} class FooCreator { public function create(FooAlias $foo) { } } $foo = new Bar; $creator = new FooCreator(); $alias = new FooAlias; var_dump($alias); $creator->create($foo);
based on oM65J

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.0110.00416.72
7.2.00.0070.00719.49
7.1.200.0030.00915.81
7.1.100.0040.00818.03
7.1.70.0070.01316.75
7.1.60.0180.00719.36
7.1.50.0000.01116.52
7.1.00.0070.07322.34
7.0.200.0090.00016.63
7.0.60.0070.08019.92
7.0.50.0170.06717.87
7.0.40.0100.08020.09
7.0.30.0270.06720.08
7.0.20.0400.07720.33
7.0.10.0000.09320.20
7.0.00.0030.04320.23
5.6.280.0030.05020.82
5.6.210.0100.06320.49
5.6.200.0100.08318.19
5.6.190.0030.09320.52
5.6.180.0570.06320.50
5.6.170.0230.08020.52
5.6.160.0130.06720.52
5.6.150.0030.08718.19
5.6.140.0100.04718.18
5.6.130.0100.08018.14
5.6.120.0100.08021.10
5.6.110.0070.04020.98
5.6.100.0100.08020.92
5.6.90.0070.07721.14
5.6.80.0000.04720.31
5.5.350.0200.07720.45
5.5.340.0030.04317.98
5.5.330.0130.07720.27
5.5.320.0000.04020.35
5.5.310.0230.08320.22
5.5.300.0030.07717.97
5.5.290.0070.06717.98
5.5.280.0070.08320.86
5.5.270.0030.04020.90
5.5.260.0100.07720.96
5.5.250.0070.08720.70
5.5.240.0200.08020.29
5.4.450.0700.06719.44
5.4.440.0600.05719.60
5.4.430.0600.05019.60
5.4.420.0700.04319.33
5.4.410.0970.04019.30
5.4.400.0600.05318.98
5.4.390.0730.05719.11
5.4.380.0630.05019.22
5.4.370.0630.05319.01
5.4.360.0600.05319.12
5.4.350.0700.05019.11
5.4.340.0670.05319.09
5.4.320.0400.05319.12
5.4.310.0570.05718.85
5.4.300.0600.04719.18
5.4.290.0530.05719.27
5.4.280.0600.05019.11
5.4.270.0600.04719.21
5.4.260.0530.05718.97
5.4.250.0630.04719.08
5.4.240.0630.06319.10
5.4.230.0770.06019.26
5.4.220.0970.06019.11
5.4.210.0930.07019.17
5.4.200.0670.04718.95
5.4.190.0770.05719.26
5.4.180.0730.06719.10
5.4.170.0900.06719.10
5.4.160.0800.04319.15
5.4.150.0800.05319.25
5.4.140.0500.06316.56
5.4.130.0630.04316.44
5.4.120.0730.05316.67
5.4.110.0830.04316.54
5.4.100.0570.06316.29
5.4.90.0730.05316.62
5.3.290.0730.04314.59
5.3.280.0470.07014.67
5.3.270.0870.07014.57
5.3.260.0570.06014.42
5.3.250.0600.05714.56
5.3.240.0730.05714.42
5.3.230.0500.05714.44
5.3.220.0600.05314.43
5.3.210.0530.05714.64
5.3.200.0770.05314.44
5.3.190.0730.05314.50