How to autoload a class with a different filename? PHP
I would like to autoload the class, but it was declared inside a different filename like this:
AClass.php
namespace path\to\A;
class AClass {}
class AException extends \Exception {}
BClass.php
namespace path\to\B;
use path\to\A\AClass; // I'm actually after AException inside
class BClass {}
class BException extends AException {}
I'm not interested in loading AClass, but AException. However, the above code is not autoloading AException.
0
source to share