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
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
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
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
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
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
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')
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(
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
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
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
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);
).
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
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
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
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
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
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
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
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
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.
: 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
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
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()
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
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.
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
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
--- 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 ?=
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
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
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
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
* 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
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
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
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 -
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:
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:
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
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
[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
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,
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
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]
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
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
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
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 ?
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
!
--
-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
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
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 ?
53 matches
Mail list logo