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 :)
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
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
echo is slightly faster than print and it takes multiple arguments so
instead of:
echo 'p' . $test . '/p';
you can do
echo 'p' , $test , '/p';
which should be faster, and I say 'should' just because as print should be
slower because it has to go into the trouble of setting up a return
On Tue, 26 Sep 2006 21:45:58 +1000, David Tulloh wrote:
Google Kreme wrote:
On 25 Sep 2006, at 06:11 , Sancar Saran wrote:
...
If this is generating hundred of K of HTML, use ' instead of
(yes, it's faster).
I've seen this stated several times and at first glance it seems to make
On Wed, September 27, 2006 3:37 am, Sancar Saran wrote:
Thanks for supporting, because of approaching the problem I don't want
to
change generate once echo one style.
And I found solution like this,
I split variable into an array and generate loop for printing, mostly
fix the
problem.
Google Kreme wrote:
On 25 Sep 2006, at 06:11 , Sancar Saran wrote:
...
If this is generating hundred of K of HTML, use ' instead of
(yes, it's faster).
I've seen this stated several times and at first glance it seems to make
sense. The double quoted version has all the \n and related
On Tuesday 26 September 2006 02:07, Robert Cummings wrote:
On Mon, 2006-09-25 at 17:39 -0600, Google Kreme wrote:
I'm sitting here with 4 Gigs of RAM trying to figure out how to use
it all... :-) (Me, in 2005)
Not really related to the post... but I find a good way to eat up 4 gigs
of RAM
On Mon, September 25, 2006 7:11 am, Sancar Saran wrote:
When I was check the performance of my system I found interesting
resuts.
My code stores html output into a variable. When page creation
complete I
printed out the variable.
Problem was generation html code takes 0.5 second and just
On Tue, September 26, 2006 12:16 pm, Børge Holen wrote:
On Tuesday 26 September 2006 02:07, Robert Cummings wrote:
On Mon, 2006-09-25 at 17:39 -0600, Google Kreme wrote:
I'm sitting here with 4 Gigs of RAM trying to figure out how to
use
it all... :-) (Me, in 2005)
Not really related to
On 9/26/06, Richard Lynch [EMAIL PROTECTED] wrote:
On Tue, September 26, 2006 12:16 pm, Børge Holen wrote:
On Tuesday 26 September 2006 02:07, Robert Cummings wrote:
On Mon, 2006-09-25 at 17:39 -0600, Google Kreme wrote:
I'm sitting here with 4 Gigs of RAM trying to figure out how to
use
On Tue, September 26, 2006 6:35 pm, Curt Zirzow wrote:
I wonder what would happen if you put your swap on a RAM disk?
I actually have done this, it works like a charm :)
you just have to ensure swap doesn't run out... of course i'd only
recomend this on a dedicated machine for like
On Tue, 2006-09-26 at 18:46 -0500, Richard Lynch wrote:
On Tue, September 26, 2006 6:35 pm, Curt Zirzow wrote:
I wonder what would happen if you put your swap on a RAM disk?
I actually have done this, it works like a charm :)
you just have to ensure swap doesn't run out... of course i'd
-- Forwarded Message --
Subject: Re: [PHP] Print or Echo takes lots of time
Date: Wednesday 27 September 2006 06:37
From: Børge Holen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
On Wednesday 27 September 2006 01:46, Richard Lynch wrote:
On Tue, September 26, 2006 6:35 pm, Curt
On 25 Sep 2006, at 06:11 , Sancar Saran wrote:
$strPage = html yada dayda;
...
$strPage.= another html tags;
...
$strPage.= getSqlDataAndCreateSomeHtmlCOde();
If this is generating hundred of K of HTML, use ' instead of
(yes, it's faster).
--
I'm sitting here with 4 Megs of RAM trying to
On Mon, 2006-09-25 at 17:39 -0600, Google Kreme wrote:
I'm sitting here with 4 Gigs of RAM trying to figure out how to use
it all... :-) (Me, in 2005)
Not really related to the post... but I find a good way to eat up 4 gigs
of RAM is to run several VMWare nodes :) Depending on what these
This has been answered several times I think
check here
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40
CAA
-Original Message-
From: Wade [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 10:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] print and echo
What's the
Thank you!
Angerer, Chad [EMAIL PROTECTED] wrote in message
9E35C54B0C7AD411B5C1009027DE539940B5ED@MSPMX01">news:9E35C54B0C7AD411B5C1009027DE539940B5ED@MSPMX01...
This has been answered several times I think
check here
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40
CAA
Than why the two different commands?
Simple - some people come from C which uses print ... others come from languages
that use echo. It fosters adaptation by other programmers.
--Joe
Thanks.
-Sterling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail:
H-
Just a quick question.
Is there any difference between using print or echo?
From what I have read and seen there isn't any.
Than why the two different commands?
Thanks.
-Sterling
See this:
http://www.php.net/manual/en/function.print.php
"As for a print vs. echo, echo
Jeff Oien wrote:
"As for a print vs. echo, echo gives you more options,
such as being able to continue output on multiple lines
like an EOT in perl. Look at the above notes. With print
you would not be able to accomplish this."
There's another difference. print() returns true on success and
See this faq :
What is the difference between echo and print?
---
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40
regards,
philip
On Fri, 6 Apr 2001, Sterling wrote:
H-
Just a quick question.
Is there any
-Original Message-
From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 06, 2001 3:24 PM
To: [EMAIL PROTECTED]
Cc: PHP
Subject: Re: [PHP] Print or Echo.
Jeff Oien wrote:
"As for a print vs. echo, echo gives you more options,
such as being able to con
Have a look here :
What is the difference between echo and print?:
---
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41
Philip
On Thu, 18 Jan 2001, Karl J. Stubsjoen wrote:
What is the basic
24 matches
Mail list logo