3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace foo { const TEST = 'foo'; } namespace bar { const TEST = 'bar'; } namespace test { var_dump(foo\TEST); var_dump(bar\TEST); }
based on 1NWgi
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Undefined constant 'test\foo\TEST' in /in/CFWP7:12 Stack trace: #0 {main} thrown in /in/CFWP7 on line 12
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Undefined constant 'test\foo\TEST' in /in/CFWP7 on line 12
Process exited with code 255.