Re: Re: Why isn't `spl_autoload` called for functions?

From: Date: Mon, 05 Nov 2012 21:29:35 +0000
Subject: Re: Re: Why isn't `spl_autoload` called for functions?
References: 1 2  Groups: php.internals php.webmaster 
Request: Send a blank email to php-webmaster+get-14921@lists.php.net to get a copy of this message
On Mon, Nov 5, 2012 at 10:16 PM, Peter Cowburn <salathe@php.net> wrote: > On 5 November 2012 20:41, Levi Morrison <morrison.levi@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. > On the other hand, now that we have namespaces it is quite feasible to put all functions in the same namespace into one file. Function autoloading would allow people to use proper namespaced functions rather than using utility classes with static methods as a hack to get the same.

« previous php.webmaster (#14921) next »