Re: print() or echo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"negligible".. blarg spelling.  :)

= = = Original message = = =

As referenced in the manual ( http://us2.php.net/manual/en/function.echo.php ), check out this url:
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40

Short story, there is a difference, but the speed difference is negligable.

If anyone cares, I prefer echo too.  Not sure why.  Shorter to type, old habits (coming more from a scripting background than a "real programming" background even though I've done some of that too), who knows?  Part of it may be the desire to have my code do what it needs to do and nothing more.  Print returns a value, which I don't use, so why would I want it to do that?   That's a little anal retentive, but every little bit helps I suppose, even if it's a negligable difference.

-TG

= = = Original message = = =

On Tue, 2007-02-13 at 19:19 +0330, Danial Rahmanzadeh wrote:
> is it true that echo is a bit faster than print()? in general, when we don't
> need a return value, which one is better to choose?

Yes, echo is faster than print. I would suggest echo over print since it
is shorter and faster :)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'



___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux