3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace test { use const nonexistent; class test { static function run(){ var_dump(nonexistent); existent; } } } namespace { define("test\\existent", "bug!", 1); test\test::run(); }
Output for 7.3.0beta1 - 7.3.0rc4
Deprecated: define(): Declaration of case-insensitive constants is deprecated in /in/FDQoF on line 15 Fatal error: Uncaught Error: Undefined constant 'nonexistent' in /in/FDQoF:8 Stack trace: #0 /in/FDQoF(16): test\test::run() #1 {main} thrown in /in/FDQoF on line 8
Process exited with code 255.
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Uncaught Error: Undefined constant 'nonexistent' in /in/FDQoF:8 Stack trace: #0 /in/FDQoF(16): test\test::run() #1 {main} thrown in /in/FDQoF on line 8
Process exited with code 255.
Output for 5.6.16 - 5.6.28
Notice: Use of undefined constant nonexistent - assumed 'nonexistent' in /in/FDQoF on line 8 string(11) "nonexistent"
Output for 5.6.0 - 5.6.15
string(4) "bug!"
Output for 5.4.0 - 5.5.38
Parse error: syntax error, unexpected 'const' (T_CONST), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /in/FDQoF on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_CONST, expecting T_STRING or T_NS_SEPARATOR in /in/FDQoF on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/FDQoF on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/FDQoF on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/FDQoF on line 3
Process exited with code 255.