3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyClass { const CONSTANT = 'constant value'; function showConstant() { echo self::CONSTANT . "\n"; } } echo MyClass::CONSTANT . "\n"; $classname = "MyClass"; echo $classname::CONSTANT . "\n"; // As of PHP 5.3.0 /*$class = new MyClass(); $class->showConstant(); echo $class::CONSTANT."\n"; // As of PHP 5.3.0/*/ ?>

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.0160.01016.41
7.3.00.0000.01216.52
7.2.130.0040.01616.91
7.2.120.0130.00516.82
7.2.110.0060.01316.88
7.2.100.0130.00316.68
7.2.90.0060.00916.89
7.2.80.0000.01316.80
7.2.70.0060.00316.95
7.2.60.0030.01517.04
7.2.50.0070.01416.67
7.2.40.0070.00416.65
7.2.30.0090.00616.89
7.2.20.0090.00616.77
7.2.10.0090.00616.91
7.2.00.0070.00718.10
7.1.250.0150.00715.96
7.1.100.0110.00717.80
7.1.70.0000.00817.22
7.1.60.0030.00717.20
7.1.50.0030.00716.80
7.1.00.0070.07322.35
7.0.200.0070.01016.32
7.0.140.0100.07022.09
7.0.60.0100.06720.06
7.0.50.0030.08317.88
7.0.40.0100.07720.09
7.0.30.0630.06320.25
7.0.20.0370.07320.09
7.0.10.0100.08020.10
7.0.00.0200.06320.25
5.6.280.0100.06721.00
5.6.210.0100.06320.50
5.6.200.0030.04018.16
5.6.190.0070.07720.48
5.6.180.4000.03020.42
5.6.170.0400.06720.62
5.6.160.0030.05020.48
5.6.150.0070.08018.21
5.6.140.0130.07318.25
5.6.130.0100.08318.27
5.6.120.0070.07021.05
5.6.110.0030.07021.11
5.6.100.0070.07721.03
5.6.90.0100.07321.13
5.6.80.0030.04720.44
5.6.70.4070.04020.50
5.5.350.0400.07020.30
5.5.340.0030.08317.98
5.5.330.0030.07020.36
5.5.320.0230.05720.30
5.5.310.0330.04720.34
5.5.300.0100.05318.07
5.5.290.0100.07317.98
5.5.280.0170.07020.98
5.5.270.0100.03320.79
5.5.260.0130.04320.80
5.5.250.0130.06020.55
5.5.240.0270.07720.07
5.4.450.0670.05319.34
5.4.440.0870.04719.31
5.4.430.0100.08019.54
5.4.420.0230.05319.23
5.4.410.0130.05719.31
5.4.400.0100.05719.12
5.4.390.0200.05719.30
5.4.380.0330.06018.70
5.4.370.0130.05318.77
5.4.360.0130.05318.72
5.4.350.0230.04318.63
5.4.340.0230.04718.63
5.4.320.0090.03312.50
5.4.310.0040.04012.50
5.4.300.0060.04012.50
5.4.290.0050.03812.50
5.4.280.0050.03612.39
5.4.270.0080.03712.39
5.4.260.0030.04412.39
5.4.250.0110.03712.39
5.4.240.0060.04112.39
5.4.230.0100.04612.39
5.4.220.0090.04712.39
5.4.210.0080.04912.39
5.4.200.0130.05912.39
5.4.190.0080.05212.38
5.4.180.0060.05412.39
5.4.170.0090.05912.39
5.4.160.0070.04912.39
5.4.150.0170.05812.39
5.4.140.0050.05512.07
5.4.130.0070.03612.06
5.4.120.0160.05812.02
5.4.110.0040.04012.01
5.4.100.0070.03612.01
5.4.90.0060.05912.01
5.4.80.0080.05012.01
5.4.70.0060.03512.01
5.4.60.0060.03512.01
5.4.50.0050.03612.01
5.4.40.0060.03412.00
5.4.30.0050.03811.99
5.4.20.0060.03812.00
5.4.10.0070.03912.00
5.4.00.0080.03811.48
5.3.290.0110.03612.80
5.3.280.0070.03912.71
5.3.270.0050.04512.73
5.3.260.0070.03812.72
5.3.250.0030.04012.72
5.3.240.0090.03512.72
5.3.230.0060.03812.71
5.3.220.0080.04512.68
5.3.210.0060.03912.68
5.3.200.0060.03712.68
5.3.190.0060.03712.68
5.3.180.0040.03812.67
5.3.170.0050.03712.67
5.3.160.0060.04412.67
5.3.150.0100.03412.67
5.3.140.0080.03512.66
5.3.130.0060.04012.66
5.3.120.0110.04112.66
5.3.110.0080.04512.65
5.3.100.0080.03812.12
5.3.90.0100.03712.09
5.3.80.0110.03912.09
5.3.70.0070.03812.09
5.3.60.0070.03612.07
5.3.50.0070.03612.02
5.3.40.0120.03112.02
5.3.30.0050.04311.97
5.3.20.0130.03211.75
5.3.10.0060.03611.73
5.3.00.0080.05311.71
5.2.170.0050.0339.21
5.2.160.0050.0439.22
5.2.150.0060.0439.21
5.2.140.0060.0439.21
5.2.130.0030.0449.18
5.2.120.0060.0319.18
5.2.110.0040.0429.18
5.2.100.0030.0319.18
5.2.90.0050.0299.18
5.2.80.0030.0339.17
5.2.70.0040.0399.17
5.2.60.0070.0279.13
5.2.50.0040.0339.10
5.2.40.0090.0289.07
5.2.30.0070.0359.05
5.2.20.0090.0369.04
5.2.10.0030.0308.95
5.2.00.0050.0298.80
5.1.60.0020.0268.09
5.1.50.0060.0228.09
5.1.40.0050.0238.07
5.1.30.0040.0258.41
5.1.20.0060.0248.44
5.1.10.0060.0248.17
5.1.00.0060.0258.16
5.0.50.0070.0186.64
5.0.40.0060.0236.50
5.0.30.0050.0346.31
5.0.20.0030.0236.28
5.0.10.0040.0196.26
5.0.00.0040.0306.25
4.4.90.0010.0254.78
4.4.80.0030.0194.76
4.4.70.0020.0164.75
4.4.60.0020.0174.75
4.4.50.0030.0164.77
4.4.40.0030.0254.71
4.4.30.0040.0144.76
4.4.20.0030.0174.85
4.4.10.0040.0204.85
4.4.00.0010.0284.76
4.3.110.0040.0164.67
4.3.100.0040.0144.67
4.3.90.0020.0154.63
4.3.80.0020.0254.59
4.3.70.0030.0154.63
4.3.60.0020.0194.62
4.3.50.0050.0184.63
4.3.40.0020.0264.54
4.3.30.0040.0153.30
4.3.20.0040.0153.28
4.3.10.0030.0153.24
4.3.00.0200.0207.27