You are here: Re: <<< performance. « PHP « IT news, forums, messages
Re: <<< performance.

Posted by Matthew Weier O'Phinney on 11/13/91 11:22

* Rodolfo Gonzalez Gonzalez <rodolfo@equinoxe.g-networks.net>:
> 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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация