NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can't get no $action

Adam Maccabee Trachtenberg adam at trachtenberg.com
Mon Apr 26 11:59:30 EDT 2004


On Mon, 26 Apr 2004, John Lacey wrote:

> The other thing that causes unnecessary hiccups to newcomers is
> the mixed use of "echo" and "print".  It may be a small matter
> to experienced folks, but my rule of thumb on this would be "use
> echo in all cases -- use print only if the code calls for it".

I am indifferent to the "echo" vs "print" dilemma. I used to use echo,
now I use print. The important part (to me) is that you pick one and
don't swap back and forth mid-function.

> Without getting into the "echo-is-slightly-faster-than-print"
> discussion, the word "echo" makes more sense to me in terms of
> "echoing to a screen/display/browser".

I think I decided I liked print better because there's no echof() or
sechof() functions. :) It seemed more consistent to use all C-style
function names instead of mixing between shell and C.

But like I said, I don't really care too much. There are actually a
few cases where echo gives you functionality that print doesn't, but
they're real edge cases, so I wouldn't code with them in mind.

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!



More information about the talk mailing list