ID: 33525 User updated by: sr at brightlight dot ch Reported By: sr at brightlight dot ch Status: Closed Bug Type: Feature/Change Request Operating System: * PHP Version: 5.* New Comment:
Yes, it works for interfaces, but you don't know whether you autoload an interface or a class. This plays a role when you have a naming scheme which differs for classes and interfaces. Since interfaces are many to many it makes sense to place interfaces in separate files and a naming scheme is never bad idea. E.g. I have a naming scheme interface.{name}.inc and class. {name}.inc Functions: why not? Is it a technical reason? Or you just don't like the idea? Previous Comments: ------------------------------------------------------------------------ [2005-06-30 20:44:32] [EMAIL PROTECTED] It already works for Interfaces. And it will never work for functions. ------------------------------------------------------------------------ [2005-06-30 16:49:02] sr at brightlight dot ch Description: ------------ __autoload() is very nice, but classes are not the only problem. Please add a parameter $type to allow functions and interfaces become autoloaded as well. Even more convenient if there were not only the types 'class', 'interface' and 'function', but also 'method' to autoload methods of classes. Example given. Reproduce code: --------------- function __autoload($name, $type) { // $type would be 'class', 'interface', 'function' or 'method' require_once("$type.$name.inc"); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33525&edit=1