Re: Re: Function Cache
| From: | Stig S. Bakken | Date: | Mon, 11 Dec 2000 09:41:15 +0000 |
| Subject: | Re: Re: Function Cache | ||
| References: | 1 2 3 4 | Groups: | php.dev php.pear |
| Request: | Send a blank email to php-dev+get-40800@lists.php.net to get a copy of this message | ||
Sterling Hughes wrote:
>
> I've have some similair functionality (id est, Perl's AUTOLOAD) for my own
> development. I was going to propose it when I had more time, but ah well,
> AUTOLOAD.
>
> Basically what this functionality would allow is that you define a function that
> then catches as missed function calls. The autoload variable would also contain
> the name of the missing function, ie:
>
> class wrapper
> {
> function AUTOLOAD()
> {
> global $AUTOLOAD;
> $args = func_get_args();
>
> print "$AUTOLOAD was called with: ";
> var_dump($args);
> }
> }
>
> $wrap = new wrapper;
>
> $wrap->hello("woohooo!");
>
> would call the AUTOLOAD function with one argument (woohooo!) and the global
> variable $AUTOLOAD would contain "hello".
The way I see it, don't get the real payoff of autoloading until you can
autoload the classes themselves.
- Stig