3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { var $my_public = array(); //forward php4 to constructor function foo() { $this->my_public[] = 'php4 constructor'; return $this->__construct(); } //constructor php5 function __construct() { $this->my_public[] = 'php4 constructor'; register_shutdown_function(array(&$this, "__destruct")); } function dump() { print_r($this->my_public); } } $test = new foo();

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.00316.84
7.2.00.0100.00319.34
7.1.200.0060.00615.52
7.1.100.0030.00617.86
7.1.70.0000.01017.15
7.1.60.0000.01719.82
7.1.50.0100.01316.64
7.1.00.0030.07722.41
7.0.200.0040.00916.68
7.0.140.0070.07022.22
7.0.60.0130.07720.07
7.0.50.0070.06317.85
7.0.40.0070.06320.04
7.0.30.0300.07720.11
7.0.20.0170.05320.23
7.0.10.0000.04720.15
7.0.00.0130.07720.20
5.6.280.0070.07021.05
5.6.210.0070.08720.52
5.6.200.0070.05318.16
5.6.190.0070.06320.68
5.6.180.0230.04720.61
5.6.170.0230.08020.45
5.6.160.0030.05720.54
5.6.150.0000.06318.29
5.6.140.0000.06018.18
5.6.130.0130.07318.16
5.6.120.0070.08020.97
5.6.110.0200.07320.96
5.6.100.0100.06021.00
5.6.90.0070.04021.01
5.6.80.0070.07320.38
5.5.350.0400.06020.33
5.5.340.0100.03318.07
5.5.330.0030.04020.25
5.5.320.0230.04320.36
5.5.310.0230.07720.34
5.5.300.0100.08018.14
5.5.290.0000.04718.04
5.5.280.0130.07720.97
5.5.270.0100.08320.89
5.5.260.0100.08020.96
5.5.250.0000.08720.71
5.5.240.0070.07720.28
5.4.450.0630.06019.69
5.4.440.0770.05719.14
5.4.430.0130.05019.46
5.4.420.0100.05719.63
5.4.410.0070.06018.80
5.4.400.0070.05318.85
5.4.390.0170.05018.82
5.4.380.0130.05018.61
5.4.370.0200.04718.47
5.4.360.0100.05718.48
5.4.350.0200.06318.78
5.4.340.0030.06018.62
5.4.320.0060.03712.51
5.4.310.0070.03612.50
5.4.300.0090.04312.51
5.4.290.0050.03912.51
5.4.280.0070.04212.40
5.4.270.0200.05718.84
5.4.260.0130.05019.10
5.4.250.0100.05718.90
5.4.240.0070.08318.95
5.4.230.0170.07018.98
5.4.220.0200.05319.00
5.4.210.0030.07718.84
5.4.200.0130.06318.83
5.4.190.0030.05319.05
5.4.180.0130.05018.98
5.4.170.0100.07318.98
5.4.160.0130.06318.72
5.4.150.0100.05018.99
5.4.140.0070.05316.61
5.4.130.0130.06316.32
5.4.120.0100.06016.47
5.4.110.0070.07016.57
5.4.100.0100.04716.38
5.4.90.0100.07016.68
5.4.80.0170.06316.47
5.4.70.0170.05316.69
5.4.60.0130.06316.54
5.4.50.0170.07016.42
5.4.40.0130.05716.59
5.4.30.0130.06016.50
5.4.20.0100.06016.46
5.4.10.0100.07016.48
5.4.00.0170.04316.03
5.3.290.0040.04112.80
5.3.280.0000.07714.61
5.3.270.0170.07014.63
5.3.260.0130.04314.52
5.3.250.0070.07014.45
5.3.240.0070.05714.70
5.3.230.0070.08014.79
5.3.220.0130.07014.68
5.3.210.0170.06014.55
5.3.200.0130.05314.41
5.3.190.0130.05714.74
5.3.180.0000.06314.40
5.3.170.0170.06014.47
5.3.160.0100.06314.66
5.3.150.0070.06314.75
5.3.140.0070.05014.74
5.3.130.0030.05714.54
5.3.120.0130.07014.56
5.3.110.0100.06314.53
5.3.100.0030.06714.13
5.3.90.0100.07314.04
5.3.80.0200.06313.93
5.3.70.0100.05014.10
5.3.60.0100.05714.00
5.3.50.0170.06014.13
5.3.40.0070.06713.97
5.3.30.0130.06313.99
5.3.20.0130.04313.52
5.3.10.0130.05313.67
5.3.00.0100.07013.71
5.2.170.0100.05311.21
5.2.160.0100.03711.22
5.2.150.0200.05311.16
5.2.140.0100.03711.30
5.2.130.0030.05011.09
5.2.120.0030.06311.09
5.2.110.0100.04711.11
5.2.100.0070.06311.20
5.2.90.0000.06011.02
5.2.80.0100.03710.93
5.2.70.0100.04311.09
5.2.60.0100.05311.13
5.2.50.0030.04310.86
5.2.40.0070.04010.98
5.2.30.0070.05310.96
5.2.20.0130.04710.97
5.2.10.0100.05011.04
5.2.00.0100.04710.71
5.1.60.0030.0479.83
5.1.50.0070.04010.10
5.1.40.0100.0339.97
5.1.30.0030.03710.34
5.1.20.0100.04710.44
5.1.10.0030.04010.05
5.1.00.0070.0339.92
5.0.50.0000.0438.62
5.0.40.0030.0308.48
5.0.30.0030.0538.06
5.0.20.0030.0378.27
5.0.10.0000.0408.27
5.0.00.0030.0438.26
4.4.90.0070.0307.35
4.4.80.0030.0307.35
4.4.70.0000.0277.35
4.4.60.0070.0237.35
4.4.50.0030.0337.35
4.4.40.0000.0477.35
4.4.30.0030.0307.35
4.4.20.0000.0377.35
4.4.10.0130.0237.35
4.4.00.0030.0377.35
4.3.110.0030.0337.35
4.3.100.0030.0207.35
4.3.90.0100.0207.35
4.3.80.0130.0277.35
4.3.70.0070.0207.35
4.3.60.0000.0237.35
4.3.50.0130.0137.35
4.3.40.0000.0477.35
4.3.30.0000.0307.35
4.3.20.0000.0277.35
4.3.10.0000.0237.35
4.3.00.0100.0236.95