Re: Re: __autoloading and functions

From: Date: Mon, 11 Sep 2006 16:42:13 +0000
Subject: Re: Re: __autoloading and functions
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-25613@lists.php.net to get a copy of this message
Maybe a dump question, but wouldn't it get considered only, AFTER PHP has found that the function does not exist?
Technically, this can be done - i.e. engine can be patched so that instead of throwing an error or refusing the call it would call appropriate function which would allow for autoloading. However, I think autoloading functions if conceptually wrong. One rarely keeps functions individually separated in different files (while this is routinely happening - and is recommended - for classes). So, if you want to autoload functions you would either have to build complex tables of where each function lives or organize them in some well-defined modules. Such modules are called "classes" in OO-speak, so if you have a group of functions that are united by purpose and you want to autoload - why not to make a class out of them? And if there's just an assortment of unrelated functions - it would probably promote very ugly code if we allow to autoload them individually.

« previous php.internals (#25613) next »