#33525 [Opn->Csd]: __autoload() for interfaces and functions

From: Date: Thu, 30 Jun 2005 18:44:33 +0000
Subject: #33525 [Opn->Csd]: __autoload() for interfaces and functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81236@lists.php.net to get a copy of this message
ID: 33525 Updated by: helly@php.net Reported By: sr at brightlight dot ch -Status: Open +Status: Closed Bug Type: Feature/Change Request -Operating System: Irrelevant +Operating System: * -PHP Version: 5.0.4 +PHP Version: 5.* New Comment: It already works for Interfaces. And it will never work for functions. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#81236) next »