3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Foo { const CONSTANT = __NAMESPACE__; $closure = function () { return CONSTANT; }; } const CONSTANT = 'GLOBAL'; var_dump($closure); namespace Bar { const CONSTANT = __NAMESPACE__; }
Output for 5.3.0 - 5.4.30
Fatal error: No code may exist outside of namespace {} in /in/t5rnj on line 12
Process exited with code 255.