3v4l.org

run code in 300+ PHP versions simultaneously
<?php const CONSTANT = 'GLOBAL'; namespace Foo { const CONSTANT = __NAMESPACE__; $closure = function () { return CONSTANT; } } namespace Bar { const CONSTANT = __NAMESPACE__; }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.30
Fatal error: Namespace declaration statement has to be the very first statement in the script in /in/8RjM6 on line 5
Process exited with code 255.

preferences:
180.23 ms | 1395 KiB | 67 Q