Re: Re: Function Cache

From: Date: Mon, 11 Dec 2000 11:46:06 +0000
Subject: Re: Re: Function Cache
References: 1 2 3 4 5 6  Groups: php.dev php.pear 
Request: Send a blank email to php-dev+get-40816@lists.php.net to get a copy of this message
Sterling Hughes wrote: > > Stig Bakken wrote: > > > > The way I see it, don't get the real payoff of autoloading until you can > > autoload the classes themselves. > > > > Come again, I don't quite understand you meaning. do you mean: > > class AUTOLOAD > { > function AUTOLOAD($class, $funcname) > { > print "$class [$funcname]: "; > var_dump(func_get_args()); > } > } > > $obj = new Mike($hello); > > would print out > > Mike [Mike]: The contents of $hello We're talking about different things. Your "autoload" is not really for autoloading anything (AFAIK you can't add methods to objects), but for catching "undefined function" errors. The autoloading I'm talking about is when you do "new foo_bar", and it require_onces "foo/bar.php" if the foo_bar class does not exist. The object proxy'ing I'm talking about is an implementation similar to that of ext/java and ext/com, where you overload an object so you can catch all method calls and property accesses, and "re-route" them in the C code, calling caching hooks (that's why you pass a reference to the original object). - Stig

« previous php.dev (#40816) next »