RE: [PHP-DEV] RFC: spl_autoload_register() should provide kind of entity to load
| From: | François Laupretre | Date: | Sun, 19 Apr 2015 13:33:30 +0000 |
| Subject: | RE: [PHP-DEV] RFC: spl_autoload_register() should provide kind of entity to load | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85868@lists.php.net to get a copy of this message | ||
> De : georges [mailto:geolim4@gmail.com]
>
> Currently spl_autoload_register() pass the name of the class entity to the
> first *Callable* argument, but there is now way (as i far i know) to know
> what kind of entity we're looking for.
> -Class ?
> -Interface ?
> -Trait?
As others already said, classes, interfaces, and trait names share the same table, and there are a
lot of places where you cannot determine the type you're looking for when autoloading a symbol.
However, we'll need to provide a type when we extend autoloading to functions and constants, if
we do it someday.
Regards
François