[PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Julien Pauli
Hello everyone. We all know the difference between print and echo, but has someone ever tried to combine them together ?? Right, try this : ?php echo coucou . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . 'tata ' . print('zozo ' . print('pupu ')); And guess the result ... Can

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Robert Cummings
On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: ?php echo coucou . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . 'tata ' . print('zozo ' . print('pupu ')); That's not cool, that's a mess. Why doe sit happen the way it does? First off, print() is a function so nesting

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Andrew Ballard
On 10/23/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: ?php echo coucou . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . 'tata ' . print('zozo ' . print('pupu ')); That's not cool, that's a mess. Why doe sit happen

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread tedd
At 11:46 AM -0400 10/23/07, Robert Cummings wrote: On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: ?php echo coucou . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . 'tata ' . print('zozo ' . print('pupu ')); That's not cool, that's a mess. Why doe sit happen the way

RE: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Instruct ICC
Hello everyone. We all know the difference between print and echo, but has someone ever tried to combine them together ?? Right, try this : ?php echo coucou . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . 'tata ' . print('zozo ' . print('pupu ')); And guess

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Robert Cummings
On Tue, 2007-10-23 at 11:54 -0400, Andrew Ballard wrote: On 10/23/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: ?php echo coucou . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . 'tata ' . print('zozo ' . print('pupu

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Andrew Ballard
On 10/23/07, Robert Cummings [EMAIL PROTECTED] wrote: My bad, print is not a function, and so: print( 'toctoc ' ).'hihi '; is equivalent to: print( 'tocktoc '.'hihi ' ); Ah. I see. I knew they were optional, but I didn't know that when you include them PHP evaluates ('toctoc')

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Julien Pauli
That's just the case : too see what happens if I agree that anyone will never meet such a case in everydays' programming. ;-) 2007/10/23, Andrew Ballard [EMAIL PROTECTED]: On 10/23/07, Robert Cummings [EMAIL PROTECTED] wrote: My bad, print is not a function, and so: print(

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/18/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: Whenever I see people put their code up for review, I realize they mostly use print instead of echo, while I am using echo 99% of the time. Actually, I can't even remember when I last

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: On 4/18/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: Whenever I see people put their code up for review, I realize they mostly use print instead of echo, while I am using echo 99% of the time. Actually, I can't even

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/21/07, Stut [EMAIL PROTECTED] wrote: Tijnema ! wrote: On 4/18/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: Whenever I see people put their code up for review, I realize they mostly use print instead of echo, while I am using

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: On 4/21/07, Stut [EMAIL PROTECTED] wrote: Tijnema ! wrote: There is a difference, echo is slightly faster. code used for benchmark: ? $start = microtime(TRUE); for ($i=0; $i10; ++$i) { print ABC; } echo sprintf(With print ($i): %0.3f\n,microtime(TRUE) - $start);

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
). Other functions (like file/stream) might be some performance difference, but you probably use this only a few times in your script. So there's not a bigger performance difference then when optimizing echo/print. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: But what else would you use a lot in your code? all commonly used things (like while, if, echo, etc) are just (nearly) as fast as their alternatives (for, print, etc). Other functions (like file/stream) might be some performance difference, but you probably use this only a few

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/22/07, Stut [EMAIL PROTECTED] wrote: Tijnema ! wrote: But what else would you use a lot in your code? all commonly used things (like while, if, echo, etc) are just (nearly) as fast as their alternatives (for, print, etc). Other functions (like file/stream) might be some performance

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: On 4/22/07, Stut [EMAIL PROTECTED] wrote: Tijnema ! wrote: But what else would you use a lot in your code? all commonly used things (like while, if, echo, etc) are just (nearly) as fast as their alternatives (for, print, etc). Other functions (like file/stream) might be

Re: [PHP] echo or print ?

2007-04-21 Thread Richard Lynch
On Sat, April 21, 2007 5:20 pm, Tijnema ! wrote: But what else would you use a lot in your code? all commonly used things (like while, if, echo, etc) are just (nearly) as fast as their alternatives (for, print, etc). Other functions (like file/stream) might be some performance difference, but

[PHP] echo or print ?

2007-04-17 Thread Christian Haensel
Good morning fellow coders I've been working with PHP for a little over 5 years now, and it even got me a cute office and a good salary... but even though I can make a living off of it, I am still wondering about a few little things. Whenever I see people put their code up for review, I

Re: [PHP] echo or print ?

2007-04-17 Thread clive
What do you guys use, and what is the advantage (if ther is any) of print over echo? And I am not talking about print_r or anything, just the regular print. :o) print returns a result, echo doesn't. This makes echo slightly faster than print, but I doubt theres any significant speed

Re: [PHP] echo or print ?

2007-04-17 Thread heavyccasey
Me too. I use echo. Print is a function. There's no significant difference between them. My advice: choose one, and stick with it. On 4/16/07, clive [EMAIL PROTECTED] wrote: What do you guys use, and what is the advantage (if ther is any) of print over echo? And I am not talking about

Re: [PHP] echo or print ?

2007-04-17 Thread Dimiter Ivanov
On 4/17/07, Christian Haensel [EMAIL PROTECTED] wrote: Good morning fellow coders I've been working with PHP for a little over 5 years now, and it even got me a cute office and a good salary... but even though I can make a living off of it, I am still wondering about a few little things.

Re: [PHP] echo or print ?

2007-04-17 Thread Christian Haensel
: Tuesday, April 17, 2007 9:48 AM Subject: Re: [PHP] echo or print ? On 4/17/07, Christian Haensel [EMAIL PROTECTED] wrote: Good morning fellow coders I've been working with PHP for a little over 5 years now, and it even got me a cute office and a good salary... but even though I can make a living

Re: [PHP] echo or print ?

2007-04-17 Thread Richard Lynch
On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: Whenever I see people put their code up for review, I realize they mostly use print instead of echo, while I am using echo 99% of the time. Actually, I can't even remember when I last used the regular print. There used to be a

Re: [PHP] echo or print

2003-11-21 Thread David T-G
Eugene, et al -- ...and then Eugene Lee said... % % p class=tonue-in-cheek % % Also, the letter 'e' is smaller than 'p', so ASCII-based function % lookups will be faster as well. Most of these speed increases can't be noticed in a small script, where the end is within a few lines, but echo()

RE: [PHP] echo or print

2003-11-21 Thread Wouter van Vliet
question (I think). Anyways, let's take this one step further to something that I've really been wondering about. (.. long bunch of HTML ..) Jay asked ?=$Question?, then Tom said ? echo $Answer; ?. ?php print 'Meanwhile a lot of others read it including '.$Strangers[0].', '.$Strangers[2].', '.$Strangers

RE: [PHP] echo or print

2003-11-21 Thread Chris W. Parker
Wouter van Vliet mailto:[EMAIL PROTECTED] on Friday, November 21, 2003 10:55 AM said: Point is, which of the inline printing style is preferred by you guyes. I tend to use ?=$Var? a lot, since it reads easier but get into struggles with myself when I do that multiple times in a row.

RE: [PHP] echo or print

2003-11-21 Thread Wouter van Vliet
Chris W. Parker wrote: Wouter van Vliet mailto:[EMAIL PROTECTED] on Friday, November 21, 2003 10:55 AM said: Point is, which of the inline printing style is preferred by you guyes. I tend to use ?=$Var? a lot, since it reads easier but get into struggles with myself when I do that

RE: [PHP] echo or print

2003-11-21 Thread Kelly Hallman
On Fri, 21 Nov 2003, Wouter van Vliet wrote: Point is, which of the inline printing style is preferred by you guyes. I tend to use ?=$Var? a lot, since it reads easier but get into struggles with myself when I do that multiple times in a row. Ultimately I think you'd want to be doing very

RE: [PHP] echo or print

2003-11-21 Thread Chris Shiflett
--- Chris W. Parker [EMAIL PROTECTED] wrote: I also prefer ?= $variable ? to ?php echo $variable; ? except that for the sake of cross-system compatibility* I now choose to do ?php echo $variable; ?. I think explicitly using echo is much more readable. While it may be obvious to many what ?=

RE: [PHP] echo or print

2003-11-21 Thread Wouter van Vliet
Kelly Hallman wrote: On Fri, 21 Nov 2003, Wouter van Vliet wrote: Point is, which of the inline printing style is preferred by you guyes. I tend to use ?=$Var? a lot, since it reads easier but get into struggles with myself when I do that multiple times in a row. Ultimately I think you'd

Re[2]: [PHP] echo or print

2003-11-21 Thread Tom Rogers
said ? echo $Answer; ?. ?php WvV print 'Meanwhile a lot of others read it including '.$Strangers[0].', WvV '.$Strangers[2].', '.$Strangers[3].' and '.$Strangers[4].'.\n; WvV echo After a short while, among others, $Kirk[firstname] {$Kirk[lastname]} WvV also said his things.; ? WvV Point is, which

Re: [PHP] echo or print

2003-11-21 Thread Eugene Lee
On Fri, Nov 21, 2003 at 07:55:05PM +0100, Wouter van Vliet wrote: : : (.. long bunch of HTML ..) : Jay asked ?=$Question?, then Tom said ? echo $Answer; ?. ?php I don't like this because it doesn't protect your content from being misinterpreted. It should be more like: Jay asked ?php

Re: [PHP] echo or print

2003-11-21 Thread Jon Kriek
Rasmus Lerdorf There is a difference between the two, but speed-wise it should be irrelevant which one you use. print() behaves like a function in that you can do: $ret = print Hello World; And $ret will be 1 That means that print can be used as part of a more complex expression where echo

Re: [PHP] echo or print

2003-11-21 Thread Curt Zirzow
* Thus wrote Wouter van Vliet ([EMAIL PROTECTED]): Point is, which of the inline printing style is preferred by you guyes. I tend to use ?=$Var? a lot, since it reads easier but get into struggles with myself when I do that multiple times in a row. 1. Turn off short_open_tags 2. Turn off

Re: [PHP] echo or print

2003-11-21 Thread Robert Cummings
On Sat, 2003-11-22 at 00:13, Curt Zirzow wrote: * Thus wrote Wouter van Vliet ([EMAIL PROTECTED]): Point is, which of the inline printing style is preferred by you guyes. I tend to use ?=$Var? a lot, since it reads easier but get into struggles with myself when I do that multiple times

[PHP] echo or print

2003-11-20 Thread Jay Fitzgerald
when should i use echo ' '; vs. print ' '; Jay Fitzgerald, Design Director - Certified Professional Webmaster (CPW-A) - Certified Professional Web Designer (CPWDS-A) - Certified Professional Web Developer (CPWDV-A) - Certified E-Commerce Manager

Re: [PHP] echo or print

2003-11-20 Thread Tom Rogers
Hi, Friday, November 21, 2003, 12:37:50 AM, you wrote: JF when should i use echo ' '; vs. print ' '; JF JF Jay Fitzgerald, Design Director JF - Certified Professional Webmaster (CPW-A) JF - Certified Professional Web Designer (CPWDS-A) JF -

Re: [PHP] echo or print

2003-11-20 Thread John W. Holmes
Jay Fitzgerald wrote: when should i use echo ' '; vs. print ' '; You should always use echo. It'll make a significant performance increase in your scripts as it's only four letters instead of five. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect:

RE: [PHP] echo or print

2003-11-20 Thread Johnson, Kirk
when should i use echo ' '; vs. print ' '; Here's a link listed in the manual at http://www.php.net/manual/en/function.print.php http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] echo or print

2003-11-20 Thread Burhan Khalid
Tom Rogers wrote: Hi, Friday, November 21, 2003, 12:37:50 AM, you wrote: JF when should i use echo ' '; vs. print ' '; JF JF Jay Fitzgerald, Design Director JF - Certified Professional Webmaster (CPW-A) JF - Certified Professional Web Designer

Re: [PHP] echo or print

2003-11-20 Thread Eugene Lee
On Thu, Nov 20, 2003 at 12:36:42PM -0500, John W. Holmes wrote: : : Jay Fitzgerald wrote: : : when should i use echo ' '; vs. print ' '; : : You should always use echo. It'll make a significant performance : increase in your scripts as it's only four letters instead of five. p

Re: [PHP] echo vs. print() performance?

2001-12-14 Thread Jim Lucas
[EMAIL PROTECTED] To: Jon Niola [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, December 13, 2001 11:50 PM Subject: Re: [PHP] echo vs. print() performance? not as a criticism, but this is among the top 10 questions asked ...or used to be for a while...anyway, there's tons of info

[PHP] echo vs. print() performance?

2001-12-13 Thread Jon Niola
Someone on this list once mentioned a performance difference between using echo and print(). Is there any evidence to back this up? I am really curious to see if it would make a difference to use one over the other. --Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] echo vs. print() performance?

2001-12-13 Thread Jack Dempsey
not as a criticism, but this is among the top 10 questions asked ...or used to be for a while...anyway, there's tons of info on the mailing lists, marc.theaimsgroup.com the short answer is that echo is SLIGHTLY faster being a language construct rather than a function...then again, i believe i

Re: [PHP] echo vs print (was echo vs printf)

2001-07-16 Thread Sheridan Saint-Michel
Ummm. I am not sure about either having a return value... but print you have $points points; and echo you have $points points; have identical output. You can drop a variable into an echo statement with no problem Sheridan - Original Message - From: Steve Brett [EMAIL PROTECTED]

Re: [PHP] echo vs print

2001-02-09 Thread Ben Peter
Maxim Maletsky wrote: Anyway, "?php" , "?" are quite same too, except that php3 used to have "?php" while older versions use mainly "?", this is just about compatibility. I believe ?php is needed if you want your scripts to be valid XML. Ben -- PHP General Mailing List

[PHP] echo vs print

2001-02-08 Thread Todd Cary
I have "Profession PHP Programming" and I see that echo() and print() are used alomst interchangeably. When should each one be used? Also, I see "?php" and "?" used. Is there a preference? And how about "};" versus "}" to end a block? I see both. Todd -- Todd Cary Ariste Software [EMAIL

RE: [PHP] echo vs print

2001-02-08 Thread Jeff Oien
From recent posts: http://www.zend.com/zend/tut/using-strings.php also see the doc for print in the PHP manual: http://www.php.net/manual/en/function.print.php Jeff Oien I have "Profession PHP Programming" and I see that echo() and print() are used alomst interchangeably. When should each one

Re: [PHP] echo vs print

2001-02-08 Thread Philip Olson
On Thu, 8 Feb 2001, Todd Cary wrote: I have "Profession PHP Programming" and I see that echo() and print() are used alomst interchangeably. When should each one be used? What is the difference between echo and print ?

RE: [PHP] Echo and Print

2001-01-26 Thread Nathan Cassano
As I understand it, echo is somewhat of an language construct and print is a function. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 11:37 AM To: [EMAIL PROTECTED] Subject: [PHP] Echo and Print I know it is a kind of stupid

RE: [PHP] Echo and Print

2001-01-26 Thread SED
! -- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 26. janar 2001 11:37 To: [EMAIL PROTECTED] Subject: [PHP] Echo and Print I know it is a kind of stupid question but I was trying to figure out the difference between "Echo" and "Prin

Re: [PHP] Echo and Print

2001-01-26 Thread kaab kaoutar
print is a function where u can add html tags like print("brb hello $name") however echo is a command where we can't include html tags ! echo "hello".$name From: Philip Olson [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Echo and Print Da

Re: [PHP] Echo and Print

2001-01-26 Thread Philip Olson
print is a function where u can add html tags like print("brb hello $name") however echo is a command where we can't include html tags ! echo "hello".$name This is VERY incorrect, please read this : What is the difference between echo and print ?