> Much better to use a *function* which is parsed once
> then include()ing or eval()ing the same code over and over to
(possibly) be
> re-parsed.
//I read file once:
$handle = fopen($fileName, "r");
$script = 'function use_cached_code(){
?>';
$script. = fread($handle, filesize($fileName));
$scrip
what do you mean by that?
Nothing. The statement was based on the erroneous assumption that
anonimous functions allow to go into HTML mode with '?>'. But this will
not stop me, for there is eval()! The general idea is simple - to use
some file's code multiple times without re-reading the file an
> If you want to cache the
> compiled php script look at Turck MMCache.
Thanks for the info, but I'll probably just use create_function() for
"caching".
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Let’s say I have function named "render", which looks like this:
I also have template "some_tmplt.php", which I need to render 100 times.
Will PHP read, parse and compile this file 100 times, or will it
"remember" file's content?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
4 matches
Mail list logo