I have a file called "init.php" where I include all my classes with a namespace. One of this will be for example : MyClass\Helper.
Always in the init, after those classes, there's an inclusion of another file ( b.php ) that uses MyClass\Helper.
Finally, this file "init" is required by the index that also uses MyClass\Helper.
So:
init.php
-> Require libs/Helper.php ( final namespace: MyClass\Helper )
-> Require b.php
-> Use MyClass\Helper
index.php
-> Require init.php
-> Use MyClass\Helper
Now I want to put in my init.php, after the inclusion of all classes
use MyClass\Helper as Helper
but it doesn't work ( class not found in the other files if I use "Helper" instead of MyClass\Helper ) and I have to put it manually in b.php ( included after the classes ) and in the index.php.
There is a way to "save" the "use as" for all files?