<?php
namespace test {
use const nonexistent;
class test {
static function run(){
var_dump(nonexistent);
existent;
}
}
}
namespace {
define("test\\existent", "bug!", 1);
test\test::run();
}
Warning: define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported 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.3.16 - 7.3.31, 7.4.0 - 7.4.33
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.
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.4.45, 5.5.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.