3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // int isn't a reserved word, right? // So this should work fine! const int = 7; // Let's try using it! var_dump(int); /* Wait, what? A parse error? Why, you might ask? (int) is a special case in the lexer. Turns out that casts are lexed specially. Why? Probably to stop the type names being reserved words... that worked out spectacularly, didn't it? The best bit, though, is that this has been around since PHP 3, so it's most likely the fault of Zeev Suraski or Andi Gutmans. Good job. */

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.0.70.0230.05719.89
7.0.60.0130.06720.91
7.0.50.0130.04719.05
7.0.40.0080.07720.31
7.0.30.0270.05720.26
7.0.20.0150.05720.30
7.0.10.0080.07520.21
7.0.00.0100.06320.31
5.6.220.0130.06720.63
5.6.210.0130.07220.49
5.6.200.0120.07219.62
5.6.190.0100.05220.78
5.6.180.0270.04220.75
5.6.170.0270.05520.94
5.6.160.0150.07320.85
5.6.150.0100.07219.72
5.6.140.0150.05319.62
5.6.130.0130.08019.69
5.6.120.0180.04721.04
5.6.110.0070.05321.13
5.6.100.0130.06521.13
5.6.90.0130.06320.98
5.6.80.0050.05220.46
5.6.70.0230.07020.40
5.6.60.0130.05320.43
5.6.50.0130.05720.45
5.6.40.0130.05720.42
5.6.30.0170.05020.41
5.6.20.0100.06020.52
5.6.10.0170.05320.50
5.6.00.0130.05720.41
5.5.360.0030.07320.59
5.5.350.0130.05720.42
5.5.340.0080.05219.39
5.5.330.0280.07220.67
5.5.320.0470.05520.47
5.5.310.0230.06520.60
5.5.300.0130.06819.45
5.5.290.0120.05219.46
5.5.280.0170.07820.82
5.5.270.0120.07220.94
5.5.260.0180.08020.72
5.5.250.0150.06020.76
5.5.240.0180.06320.31
5.5.230.0200.06020.29
5.5.220.0200.05020.29
5.5.210.0230.04320.30
5.5.200.0170.05320.23
5.5.190.0030.07720.22
5.5.180.0100.06020.22
5.5.160.0100.06020.14
5.5.150.0170.06720.28
5.5.140.0130.07720.21
5.5.130.0170.05720.19
5.5.120.0200.05020.24
5.5.110.0200.05020.26
5.5.100.0130.05719.98
5.5.90.0130.06020.11
5.5.80.0170.05320.14
5.5.70.0200.05019.96
5.5.60.0100.06320.09
5.5.50.0300.04320.13
5.5.40.0130.05720.11
5.5.30.0200.05020.09
5.5.20.0230.06719.98
5.5.10.0130.06020.14
5.5.00.0230.07020.08
5.4.450.0080.04819.43
5.4.440.0100.04819.31
5.4.430.0070.04819.45
5.4.420.0150.04519.35
5.4.410.0050.05019.13
5.4.400.0130.04019.09
5.4.390.0120.04319.17
5.4.380.0120.04219.18
5.4.370.0050.04719.03
5.4.360.0100.05019.02
5.4.350.0080.05319.17
5.4.340.0030.05219.07
5.4.320.0150.04219.26
5.4.310.0130.05319.24
5.4.300.0150.05819.02
5.4.290.0120.06319.11
5.4.280.0100.07019.13
5.4.270.0080.06319.02
5.4.260.0070.06718.88
5.4.250.0100.06319.20
5.4.240.0080.06519.17
5.4.230.0220.05319.04
5.4.220.0100.05319.09
5.4.210.0130.05818.88
5.4.200.0080.05219.23
5.4.190.0100.05318.99
5.4.180.0100.06719.15
5.4.170.0200.05319.01
5.4.160.0170.04319.07
5.4.150.0100.07219.01
5.4.140.0070.05816.40
5.4.130.0170.06816.41
5.4.120.0320.04716.44
5.4.110.0220.06816.33
5.4.100.0330.04716.43
5.4.90.0380.06216.29
5.4.80.0250.04216.43
5.4.70.0200.05316.56
5.4.60.0220.06016.42
5.4.50.0250.04716.32
5.4.40.0250.04016.50
5.4.30.0200.05816.44
5.4.20.0170.04316.28
5.4.10.0180.05816.35
5.4.00.0180.05715.88
5.3.290.0080.04514.60
5.3.280.0100.05314.53
5.3.270.0070.07314.55
5.3.260.0070.07014.51
5.3.250.0170.07214.62
5.3.240.0380.05514.51
5.3.230.0350.06814.53
5.3.220.0280.06714.52
5.3.210.0180.05714.49
5.3.200.0250.07014.51
5.3.190.0150.04514.55
5.3.180.0220.06514.51
5.3.170.0230.05214.46
5.3.160.0230.04714.58
5.3.150.0180.06314.51
5.3.140.0230.04014.47
5.3.130.0220.06214.48
5.3.120.0200.05714.38
5.3.110.0180.06314.57
5.3.100.0170.05313.98
5.3.90.0130.06513.92
5.3.80.0150.06513.97
5.3.70.0170.05713.99
5.3.60.0180.06013.82
5.3.50.0170.05013.95
5.3.40.0200.04713.89
5.3.30.0130.06213.90
5.3.20.0170.07213.61
5.3.10.0230.06213.61
5.3.00.0170.06513.45