3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Test { function sqrt($arg=null) { return 'test'; } } namespace Second { function sqrt($arg=null) { return 'second'; } } namespace { use function Test\sqrt; use function Second\sqrt; echo sqrt(); }
based on cH9KB
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Fatal error: Cannot use function Second\sqrt as sqrt because the name is already in use in /in/Oitfi on line 22
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot use function Second\sqrt as sqrt because the name is already in use in (Line: 22, Char: 25) in /in/Oitfi:22 Stack trace: #0 {main}
Process exited with code 255.