| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
| View Poll Results: Print or echo? | |||
| | 2 | 11.11% | |
| echo | | 15 | 83.33% |
| What are you even talking about? | | 1 | 5.56% |
| Voters: 18. You may not vote on this poll | |||
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() | When programming php do you use.... print or echo? I use print(""); I will never use print ""; i will use print $cls[tpl]->fetch("tpl"); I never use echo ![]() I know this is something stupid... but its just something that struck me to ask ^^ |
| |
| | #4 (permalink) |
| DNOA Certified Seller ![]() Join Date: Apr 2005 Location: Arizona
Posts: 3,680
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I use echo because that's what this "Learn PHP5 in 5 seconds" book told me to use.
__________________ Nombrex.com |
| |
| | #5 (permalink) |
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | i use echo("") because it sounds cooler than print lol.
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| |
| | #7 (permalink) |
| NamePros Regular Join Date: May 2005 Location: Northern Ireland
Posts: 756
![]() ![]() | echo is what I use
__________________ A young web developer’s journey to financial freedom - aaronfalloon.com |
| |
| | THREAD STARTER #9 (permalink) | ||||
| Account Closed Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() | Alright, echo IS faster than print. But! Heres why: echo is 4 characters (4 bytes) print is 5 characters (5 bytes) That difference would only matter on a system below a 1ghz processor hell, its hardly noticable!The ONLY difference is 1byte of space... so even 1milisecond... heh thats not bad cause i only have 3 print statements per file execution.PHP Code:
http://php.net/print Always returns true. Or 1. Its a language constructor | ||||
| |
| | #10 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | just a note to those using echo("") as per the php manual you do not need to use parentheses with it echo "" will work perfectly fine. I personally use echo "" as it is what I have just got used to doing.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | THREAD STARTER #11 (permalink) | ||||
| Account Closed Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() |
When i was "learning" php, i started using echo... but when i asked for help on a forum, the people would change it from echo to print when they replied... no clue why :-/ So i said the hell with it and started using print lol | ||||
| |
| | #12 (permalink) | ||||
| NamePros Regular Join Date: Aug 2005
Posts: 214
![]() |
It does however, take additional time to process the return value (1), but very negligble. It's really a moot issue, use what you feel comfortable with. And who uses multiple echo/print's per page anyways?
__________________ OnlineGames.net | ||||
| |
| | #16 (permalink) |
| A Wealth of Knowledge Join Date: Aug 2004
Posts: 3,809
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: Getting started with PHP (The Basics) | deadserious | Webmaster Tutorials | 60 | 11-17-2007 12:35 PM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 10:09 AM |
| Professional PHP & MySQL programming! | CreativeLogic | For Sale / Advertising Board | 0 | 06-07-2004 09:26 PM |