Re: __autoload() enhancement

From: Date: Sun, 03 Apr 2005 14:24:20 +0000
Subject: Re: __autoload() enhancement
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-15757@lists.php.net to get a copy of this message
On Apr 3, 2005, at 6:05 AM, Zeev Suraski wrote:
What I'd like to suggest is a change in the behavior of __autoload(), so that multiple __autoload()'s could be defined. Essentially, declaring __autoload() would in fact add the function to the list of functions that are called in case a missing class is referenced. However, it will not actually place a function named __autoload() in the PHP function table. That way, it would be possible to declare multiple __autoloads(), and have all of them called when a missing class is spotted.
Coupled with namespaces, declaring multiple __autoload functions seems natural: namespace x { function __autoload() { } ... } namespace y { function __autoload() { } ... } Absent namespaces, the symbol table manipulation seems a bit magical to me. Just brainstorming here, but why not an __autoload for functions?

« previous php.internals (#15757) next »