Re: long echo statement performance question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 06 February 2009 19:12:08 Frank Stanovcak wrote:
> I'm in the process of seperating logic from display in a section of code,
> and wanted to make sure I wasn't treading on a performance landmine here,
> so I ask you wizened masters of the dark arts this...
>
> is there a serious performance hit, or reason not to use long, ie more than
> 30 - 40 lines, comma conjoined echo statments...
>
> echo 'blah', $var, 'blah', $var2,...ad nauseum
>
> ... to output mixed html and php var values?  If so could you refer me to a
> work around, or better way?
>
> Frank

Seperate logic.

Not the template.

<?=$variable?> was good for templating. With opcode cache all your template 
was cached.

And of course you should not use write functions in templates.

and if you really want to do this with

echo  yada yada I suggest this one.

$output = '';


do someting remove echo  and put $output.

and end of the script

do echo $output.

This was the best way. Of course you can use output buffering. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux