3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace { const TEST_CONST1 = true; define("TEST_CONST2", true); function testExistConst() { var_dump(constant("TEST_CONST1")); var_dump(constant("TEST_CONST2")); var_dump(TEST_CONST1); var_dump(TEST_CONST2); } }

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.01016.49
7.2.00.0060.00619.22
7.1.200.0060.00615.56
7.1.100.0030.00918.05
7.1.70.0000.00716.98
7.1.60.0070.01419.22
7.1.50.0070.01416.85
7.1.00.0070.07022.43
7.0.200.0030.00616.68
7.0.140.0000.07322.08
7.0.60.0130.07319.91
7.0.50.0000.05017.84
7.0.40.0070.08020.25
7.0.30.0370.04720.08
7.0.20.0200.04320.33
7.0.10.0030.07720.12
7.0.00.0070.08320.15
5.6.280.0130.06320.99
5.6.210.0030.04020.53
5.6.200.0030.04718.24
5.6.190.0100.08720.61
5.6.180.0200.04720.63
5.6.170.0200.05720.44
5.6.160.0030.09020.44
5.6.150.0100.05718.19
5.6.140.0000.07718.18
5.6.130.0130.06018.18
5.6.120.0300.06721.04
5.6.110.0130.08321.04
5.6.100.0000.04721.00
5.6.90.0130.03720.89
5.6.80.0070.08020.44
5.5.350.0130.08020.44
5.5.340.0130.07718.02
5.5.330.0070.07020.55
5.5.320.0370.07020.27
5.5.310.0070.04720.32
5.5.300.0000.04717.95
5.5.290.0030.04018.03
5.5.280.0200.07020.95
5.5.270.0070.03720.88
5.5.260.0130.07020.86
5.5.250.0030.07320.69
5.5.240.0130.06720.07
5.4.450.0170.06319.47
5.4.440.0300.06719.44
5.4.430.0170.05319.57
5.4.420.0200.05019.44
5.4.410.0070.06319.32
5.4.400.0230.04719.32
5.4.390.0200.06318.96
5.4.380.0200.05318.59
5.4.370.0200.05318.78
5.4.360.0200.05318.86
5.4.350.0300.04718.59
5.4.340.0100.06018.59
5.4.320.0170.05718.83
5.4.310.0170.05318.76
5.4.300.0230.06018.72
5.4.290.0200.05318.85
5.4.280.0300.04018.55
5.4.270.0200.05018.79
5.4.260.0170.06018.83
5.4.250.0270.04718.50
5.4.240.0300.04718.61
5.4.230.0300.05318.60
5.4.220.0200.05318.59
5.4.210.0130.05718.79
5.4.200.0130.05016.71
5.4.190.0130.06018.75
5.4.180.0200.05318.48
5.4.170.0170.05718.58
5.4.160.0230.05318.50
5.4.150.0100.06718.80
5.4.140.0300.04316.27
5.4.130.0230.04316.37
5.4.120.0170.05316.35
5.4.110.0200.04316.28
5.4.100.0200.05316.28
5.4.90.0230.05016.48
5.4.80.0200.05316.21
5.4.70.0330.05716.11
5.4.60.0170.06716.19
5.4.50.0170.04716.30
5.4.40.0230.04716.26
5.4.30.0130.05316.17
5.4.20.0200.05016.29
5.4.10.0070.06016.22
5.4.00.0200.04715.64
5.3.290.0170.05714.71
5.3.280.0130.05714.79
5.3.270.0200.06014.59
5.3.260.0200.05714.63
5.3.250.0170.05314.63
5.3.240.0170.05714.77
5.3.230.0200.05714.65
5.3.220.0230.05714.76
5.3.210.0170.06014.70
5.3.200.0170.05314.75
5.3.190.0270.05014.56
5.3.180.0200.05014.66
5.3.170.0230.05014.72
5.3.160.0200.05314.61
5.3.150.0230.05314.65
5.3.140.0230.06314.67
5.3.130.0130.06714.59
5.3.120.0330.04014.70
5.3.110.0170.05714.68
5.3.100.0270.04314.09
5.3.90.0170.05314.04
5.3.80.0230.04714.13
5.3.70.0200.05014.01
5.3.60.0200.05013.98
5.3.50.0230.05014.00
5.3.40.0270.05313.99
5.3.30.0130.05714.13
5.3.20.0330.04013.66
5.3.10.0100.06013.76
5.3.00.0230.06013.73
5.2.170.0170.05011.30
5.2.160.0130.04311.20
5.2.150.0230.03311.28
5.2.140.0200.04011.17
5.2.130.0100.04311.23
5.2.120.0170.05011.16
5.2.110.0130.04011.16
5.2.100.0070.04711.06
5.2.90.0200.03711.07
5.2.80.0130.04711.10
5.2.70.0100.05711.04
5.2.60.0170.05011.00
5.2.50.0100.04710.97
5.2.40.0100.04011.01
5.2.30.0100.04311.14
5.2.20.0100.04310.92
5.2.10.0130.04010.89
5.2.00.0100.04010.77
5.1.60.0170.03010.02
5.1.50.0170.03010.02
5.1.40.0100.03710.00
5.1.30.0170.03310.38
5.1.20.0170.03310.37
5.1.10.0130.03310.10
5.1.00.0100.04310.09
5.0.50.0100.0278.58
5.0.40.0130.0238.46
5.0.30.0070.0438.36
5.0.20.0000.0338.21
5.0.10.0070.0308.16
5.0.00.0070.0438.30
4.4.90.0030.0236.64
4.4.80.0100.0176.64
4.4.70.0000.0276.64
4.4.60.0000.0276.64
4.4.50.0070.0236.64
4.4.40.0070.0336.64
4.4.30.0030.0276.64
4.4.20.0130.0236.64
4.4.10.0100.0176.64
4.4.00.0100.0376.64
4.3.110.0100.0236.64
4.3.100.0000.0276.64
4.3.90.0070.0206.64
4.3.80.0070.0336.64
4.3.70.0070.0236.64
4.3.60.0030.0276.64
4.3.50.0070.0206.64
4.3.40.0070.0336.64
4.3.30.0000.0306.64
4.3.20.0000.0276.64
4.3.10.0000.0276.64
4.3.00.0070.0277.59