Re: RFC: spl_autoload_register() should provide kind of entity to load

From: Date: Sat, 18 Apr 2015 15:26:10 +0000
Subject: Re: RFC: spl_autoload_register() should provide kind of entity to load
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-85864@lists.php.net to get a copy of this message
On Sat, Apr 18, 2015 at 4:24 PM, georges <geolim4@gmail.com> wrote: > ​Hi php internals, > > 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? > > > A second argument should be added to the *Callable* function describing > what kind of entity we're looking for. > This is not possible, because we do not generally know if something is a class or an interface or a trait when autoloading it. E.g. if I write class_alias('X', 'Y') and X is autoloaded, it could be a class an interface or a trait - it just doesn't matter. Nikita

« previous php.internals (#85864) next »