Re: performance improvement using include(), possible to cache included code?

From: Date: Tue, 13 Jun 2000 17:24:23 +0000
Subject: Re: performance improvement using include(), possible to cache included code?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-21222@lists.php.net to get a copy of this message
Thx, a lot - I think create_function() is *exactly* what I searched for. I wondered what create_function() is for in the lambda-war two weeks ago or so... I did not find any doc on how to use it and the code snipplet provided two weeks ago or so was not very clear. Could you tell me where to search for documentation on how to use it. regards Stanislav Malyshev wrote:
w>> I do *not* want a programmer to *modify* the Application file, because w>> he then would have to *modifiy a complex script* and at least insert the w>> code two time (pre-calculation how much time the script ought to need, w>> the actual mass-executing of the code to be tested). Instead the user w>> could use the two given User-Files. w>> w>> Extract: Some code from an external file should be evalulated every w>> time, but not read every time. So, why can't you use require, I don't see? Another solution - use create_function (or whatever name was decided on lambda at the end) to compile the code and then run it multiple times. w>> w>> <?php w>> $string=<<<END w>> $i+1; w>> $a='test'; w>> END; w>> ?> w>> w>> It is simply *impossible* to store the real *unevalulated* string w>> >> $i+1;\n$a='test'; << into $string, because HERE DOCS evalulate every w>> line (@dave: that?s perhaps the *reason of slowlyness*) - it would be Wrong. Heredoc evaluates nothing, it just resolves variables. But I think that's what you were meaning. Use \$ instead of $ if you don't want it (yes, preg_replace on user-supplied data). Or use create_function. w>> VERY handy if one is able to use here docs (or another, similar syntax) w>> which *stores everything* between the start/end marks without w>> evalulation (very fast, evalulation of code from other files is possible). w>> Extract: Option(?) to tell <<< not to evalulate code between start/end w>> markers Well, I see. Perl has <<"MARK" and <<'MARK' for this.
-- o----------0-¬---------O-·---¬----o---®-----o o O ° . | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ ° · 0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ ° o © ° . · | psychedelic experience | gott@kiffen.de | O ° o ° o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·

« previous php.dev (#21222) next »