Re: Procedural Autoloader?

From: Date: Mon, 22 Nov 2010 21:47:01 +0000
Subject: Re: Procedural Autoloader?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-309627@lists.php.net to get a copy of this message
On 22 November 2010 22:40, Daniel P. Brown <daniel.brown@parasane.net> wrote: > On Mon, Nov 22, 2010 at 16:31, Nathan Nobbe <quickshiftin@gmail.com> wrote: >> >> Shrug, if you want to really be dirty about it, you could just put a 'class' >> atop each file of functions. >> <?php >> class IWishTheseFunctionsWereOOInstead {} // :P >> function firstProceeduralFunc() { >>  // .. >> } >> ?> > >    That's not going to be economical or allow him to autoload, > though, because the autoloader is called when the class is > instantiated. Not to mention that it has nothing to do with a procedural autoloader. Autoloading takes place if you try to instantiate an object of a class that PHP doesn't know about (yet). There is no such thing for functions. Either refactor your code so you don't have this problem (The Way To Go [tm]) or make an extension. End of discussion. Regards Peter -- <hype> WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15 </hype>

« previous php.general (#309627) next »