2012/11/5 Peter Cowburn <sala...@php.net>

> Pushing to internals list.
>
> On 5 November 2012 20:41, Levi Morrison <morrison.l...@gmail.com> wrote:
> > I hear people complaining about this out in user-land all the time, but
> > I've never seen anyone from internals respond. With practically everyone
> > using an autoloader these days, it really borks your workflow to use
> > `require_once` just to load a function.
> >
> > So why don't we call `spl_autoload` for undefined functions? Are there
> > technical reasons, or has this not been discussed?
>
> IIRC correctly, one strong point for autoloading classes catching on
> was because of the existing one-class-per-file practice; folks were
> already having files named after a class and only containing said
> class.  The same never really caught on for individual functions.
>

Thats not really an argument, because once the autoloader find a undfined
function, a custom loader is called anyway and this one can include a file
with multiple functions (or classes, or constants, ...). (As a side note:
The current autoloader could include files with multiple classes too ;))

I've asked this question for a while (one, or two years ago or so). Must
say, that I didn't remember the answer, but I would like to see autoloading
for namespace-constants and functions too :)

Regards,
Sebastian


>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
github.com/KingCrunch

Reply via email to