You are here: Re: Echo vs Print « PHP Programming Language « IT news, forums, messages
Re: Echo vs Print

Posted by Andy Hassall on 06/02/05 01:24

On Wed, 1 Jun 2005 15:11:34 -0700, "Tony" <someone@somewhere.not> wrote:

>I'm just wondering why it seems most people use "echo" instead of "print". I
>tend to use "print", probably because I started programming in BASIC back in
>78, so it's just familiar.
>
>Echo can take multiple expressions (as in "echo
>$string1,$string2,$string3"), which apparently is a bit faster than multiple
>concatenations. But for basic output, there doesn't seem to be a noticeable
>difference. The speed test at http://dynacker.dotgeek.org/printvsecho/ shows
>a "5%" difference in speed, but this amounts to a negligible difference in
>actual execution time on a typical script.
>
>So - why does one choose "echo" over "print", or vice-versa?

I use print, with the only reason being that I am quite fond of printf - so if
I change a line from print to printf I only need to add a character.

Possibly with a further reason that I use Perl a bit as well, which uses
'print'.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

 

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

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