3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* https://bugs.php.net/bug.php?id=67897 */ namespace Foo\Bar\Baz; function before(){ return A_RELATIVE_CONSTANT; } define('A_RELATIVE_CONSTANT', 'GLOBAL'); var_dump(before()); define('Foo\\Bar\\Baz\\A_RELATIVE_CONSTANT', 'RELATIVE'); function after(){ return A_RELATIVE_CONSTANT; } var_dump(before()); var_dump(after());

preferences:
32.16 ms | 405 KiB | 6 Q