Re: print vs heredoc
| From: | Tom Rogers | Date: | Tue, 08 Jul 2003 04:24:19 +0000 |
| Subject: | Re: print vs heredoc | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154304@lists.php.net to get a copy of this message | ||
Hi,
Monday, July 7, 2003, 11:33:38 PM, you wrote:
SK> Hi, again!!
SK> I'm looking for opinions as to which is better/faster, print or heredoc.
SK> print makes the code layout look nice and eazy to debug, where heredoc IS faster but makes
SK> the code look like a nightmare with everything jammed against the left side of the code. I'm
SK> pretty
SK> picky about what looks good and heredoc is a nightmare of horrors...
SK> Robin E. Kopetzky
SK> Black Mesa Computers/Internet Services
SK> www.blackmesa-isp.net
As to which is faster is does not really matter as the speed of echo
print and heredoc is dictated by the connection speed to the
requesting client. If this is a factor in your overall operation you
can use output buffering to save the contents and output them at the end of
your script.
btw what would be nice is a print_raw command that does no
parsing just sends the stuff :)
(Would be good for template systems where you know there is no php
hidden in there.) ... might gain a couple of micro seconds
--
regards,
Tom