Re: Function caching...

From: Date: Fri, 08 Dec 2000 21:08:31 +0000
Subject: Re: Function caching...
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-40606@lists.php.net to get a copy of this message
Zeev Suraski wrote: > I'm not exactly sure what you meant in the 'Cachable function' term. A function is meant to be cachable if it returns the same value and generates the same output for the same given arguments. This means, that a cachable function must not use global or static variables, must not rely on database queries and so on. > What would be cached? The status of the local variables? No. > The output? The function's return value and its output. > If it's > one of those two, then both of them are fairly easy to implement today > (even though we can always think of ways to improve it, if you think it's > necessary). If it's something else - please clarify. I'm currently working on an implementation of Function Caching in native PHP, you can have a look at it here - http://gravedancer.rc5.de/cache.phps - http://gravedancer.rc5.de/cache_test.phps Anyways, Kristian's proposal of a implemenation in the language itself using callbacks would be better. -- <? print implode( "", array_reverse( preg_split( "//", "dlrow laer " . "eht ot emoclew" ) ) ); /* visit http://www.sebastian-bergmann.de/ */ ?>

« previous php.dev (#40606) next »