* Rodolfo Gonzalez Gonzalez <[EMAIL PROTECTED]>:
> this could be a silly question. Is there some performance penalty when 
> using the <<< operator like this:
>
> $var =<<<EOP
> add a bunch of text here
> and here
> EOP;
>
> Just curious.

Try doing some benchmarks using microtime(). My gut reaction is that
there shouldn't be any difference; heredoc syntax is simply another form
of quoting strings.

The other factor to consider is if a few microseconds more of processing
time is worth the extra programming time it takes to get quotes right
(assuming heredoc syntax *does* take longer). I personally prefer
heredocs when using long, multiline strings to using double quotes --
they're easier to maintain.

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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

Reply via email to