<?php
namespace foo {
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
}
?>
Fatal error: Uncaught Error: Class "bar\Xyz" not found in /in/c3l8K:22
Stack trace:
#0 {main}
thrown in /in/c3l8K on line 22
Process exited with code 255.
Fatal error: Uncaught Error: Class 'bar\Xyz' not found in /in/c3l8K:22
Stack trace:
#0 {main}
thrown in /in/c3l8K on line 22
Process exited with code 255.