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?

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



Reply via email to