3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ThrowsError { public $name = 'unnamed'; public function __construct($name) { $this->name = $name; throw new \Exception("I blew up the constructor of '$name'\n"); } } $emptyVar = null; $obj = (object)array('number' => 1); try { $emptyVar = new ThrowsError('emptyVar'); } catch (\Exception $e) { print($e->getMessage()); } try { $obj = new ThrowsError('obj'); } catch (\Exception $e) { print($e->getMessage()); } try { $notPreviouslyDefined = new ThrowsError('notPreviouslyDefined'); } catch (\Exception $e) { print($e->getMessage()); } var_dump($emptyVar); var_dump($obj); var_dump($notPreviouslyDefined);

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.00.0030.01319.60
7.1.100.0000.01217.55
7.1.70.0040.00417.01
7.1.60.0030.02219.82
7.1.50.0140.01017.05
7.1.00.0130.02322.57
7.0.200.0000.00816.79
7.0.140.0100.06721.95
7.0.60.0130.07019.99
7.0.50.0100.05017.89
7.0.40.0100.08020.05
7.0.30.0230.04320.34
7.0.20.0270.05720.23
7.0.10.0000.04720.19
7.0.00.0130.06720.16
5.6.280.0030.07320.89
5.6.210.0170.06320.75
5.6.200.0100.07718.22
5.6.190.0070.04020.47
5.6.180.0230.05020.50
5.6.170.0230.06020.60
5.6.160.0070.09020.46
5.6.150.0070.07018.14
5.6.140.0070.08018.27
5.6.130.0070.04318.24
5.6.120.0100.08321.06
5.6.110.0030.04321.13
5.6.100.0230.07321.06
5.6.90.0170.07321.00
5.6.80.0130.07020.38
5.5.350.0070.02720.43
5.5.340.0100.07717.97
5.5.330.0070.05720.43
5.5.320.0270.04720.52
5.5.310.0200.07020.35
5.5.300.0100.03718.05
5.5.290.0100.06717.99
5.5.280.0000.05320.90
5.5.270.0100.08320.68
5.5.260.0070.08020.80
5.5.250.0200.06320.61
5.5.240.0370.06320.16
5.4.450.0700.05719.63
5.4.440.0800.06319.47
5.4.430.0600.08019.61
5.4.420.0570.06319.47
5.4.410.0670.07719.33
5.4.400.0730.05319.25
5.4.390.0630.05018.82
5.4.380.0230.08718.47
5.4.370.0500.05318.50
5.4.360.0170.06318.51
5.4.350.0200.06018.75
5.4.340.0200.05018.62
5.4.320.0060.04412.50
5.4.310.0050.03912.49
5.4.300.0050.03712.50
5.4.290.0060.04212.50
5.4.280.0080.04012.39
5.4.270.0050.03712.39
5.4.260.0170.06319.02
5.4.250.0130.07318.76
5.4.240.0170.06318.66
5.4.230.0200.06719.01
5.4.220.0230.06318.79
5.4.210.0170.07718.74
5.4.200.0130.05718.80
5.4.190.0130.06718.64
5.4.180.0170.06718.78
5.4.170.0130.07018.96
5.4.160.0200.06718.98
5.4.150.0030.06018.73
5.4.140.0100.07016.60
5.4.130.0230.05016.38
5.4.120.0200.05016.36
5.4.110.0100.05016.62
5.4.100.0030.05316.36
5.4.90.0000.06316.40
5.4.80.0100.07316.55
5.4.70.0030.07316.64
5.4.60.0070.05716.59
5.4.50.0070.05316.54
5.4.40.0000.07016.39
5.4.30.0070.06316.53
5.4.20.0170.04316.40
5.4.10.0100.05316.45
5.4.00.0170.05015.93
5.3.290.0070.03712.80
5.3.280.0100.05314.68
5.3.270.0130.06314.64
5.3.260.0200.05714.68
5.3.250.0070.06014.59
5.3.240.0130.07014.60
5.3.230.0100.07314.82
5.3.220.0100.06714.75
5.3.210.0030.06014.41
5.3.200.0170.06714.71
5.3.190.0030.06014.75
5.3.180.0100.07014.54
5.3.170.0030.05714.54
5.3.160.0100.06314.40
5.3.150.0170.06014.70
5.3.140.0170.05314.65
5.3.130.0100.05014.65
5.3.120.0070.05314.54
5.3.110.0230.05714.68
5.3.100.0030.06714.17
5.3.90.0030.05314.00
5.3.80.0100.06714.04
5.3.70.0170.05314.18
5.3.60.0170.06014.22
5.3.50.0030.06014.11
5.3.40.0030.07013.92
5.3.30.0070.05713.99
5.3.20.0300.06313.71
5.3.10.0100.04713.62
5.3.00.0070.06713.62
5.2.170.0130.05311.36
5.2.160.0070.04311.23
5.2.150.0000.04711.24
5.2.140.0070.05011.32
5.2.130.0030.04311.26
5.2.120.0030.04311.00
5.2.110.0100.05311.01
5.2.100.0130.05011.10
5.2.90.0100.04010.93
5.2.80.0100.05711.08
5.2.70.0030.06311.08
5.2.60.0030.05711.12
5.2.50.0030.06311.11
5.2.40.0030.05711.07
5.2.30.0100.03710.80
5.2.20.0130.05010.97
5.2.10.0070.05710.95
5.2.00.0030.06010.56
5.1.60.0070.0479.96
5.1.50.0100.03010.05
5.1.40.0070.0339.99
5.1.30.0030.04010.47
5.1.20.0030.05310.31
5.1.10.0100.04310.07
5.1.00.0130.04310.04
5.0.50.0100.0238.50
5.0.40.0000.0308.37
5.0.30.0030.0638.32
5.0.20.0070.0378.29
5.0.10.0070.0278.15
5.0.00.0000.0508.16
4.4.90.0070.0207.41
4.4.80.0000.0307.41
4.4.70.0030.0277.41
4.4.60.0070.0237.41
4.4.50.0000.0337.41
4.4.40.0030.0337.41
4.4.30.0070.0277.41
4.4.20.0030.0307.41
4.4.10.0000.0307.41
4.4.00.0030.0477.41
4.3.110.0000.0277.41
4.3.100.0030.0307.41
4.3.90.0030.0207.41
4.3.80.0070.0377.41
4.3.70.0030.0307.41
4.3.60.0030.0277.41
4.3.50.0000.0277.41
4.3.40.0000.0337.41
4.3.30.0000.0237.41
4.3.20.0000.0237.41
4.3.10.0000.0237.41
4.3.00.0130.0178.11