3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo { class Xyz {} function abc () {} } namespace bar { class Xyz {} function abc () {} } namespace bar { use foo\Xyz; use foo\abc; new Xyz(); // instantiates \foo\Xyz new namespace\Xyz(); // instantiates \bar\Xyz abc(); // invokes \bar\abc regardless of the second use statement \foo\abc(); // it has to be invoked using the fully qualified name } ?>
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.23
Fatal error: Cannot use foo\Xyz as Xyz because the name is already in use in /in/UisPe on line 15
Process exited with code 255.

preferences:
188.04 ms | 940 KiB | 61 Q