Re: [PHP] which one is faster

2010-10-08 Thread Nathan Rixham
chris h wrote: Saeed here's a quick (and dirty) test I ran: $tests = 100; $start = microtime(true); for ($i=0; $i$tests; $i++) { $a = md5( rand() ); $b = md5( rand() ); $c = $a.$b; } var_dump( By concat op:\t. (microtime(true) - $start) ); that's not a fair test because you have

RE: [PHP] which one is faster

2010-10-06 Thread Bob McConnell
From: Steve Staples On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out! :)

Re: [PHP] which one is faster

2010-10-06 Thread Peter Lind
On 6 October 2010 14:40, Bob McConnell r...@cbord.com wrote: From: Steve Staples On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400,

Re: [PHP] which one is faster

2010-10-06 Thread Robert Cummings
On 10-10-06 08:52 AM, Peter Lind wrote: Where exactly do you get the part about double quotes from? Can't seem to locate it in the any of the relevant specs (xhtml or xml). Also, never seen an xml or xhtml validator choke on single quotes. http://www.w3.org/TR/xhtml1/#h-4.2 Cheers, Rob. --

Re: [PHP] which one is faster

2010-10-06 Thread Robert Cummings
On 10-10-06 09:06 AM, Peter Lind wrote: On 6 October 2010 15:03, Robert Cummingsrob...@interjinn.com wrote: On 10-10-06 08:52 AM, Peter Lind wrote: Where exactly do you get the part about double quotes from? Can't seem to locate it in the any of the relevant specs (xhtml or xml). Also, never

Re: [PHP] which one is faster

2010-10-06 Thread Andy McKenzie
On Wed, Oct 6, 2010 at 9:03 AM, Robert Cummings rob...@interjinn.com wrote: On 10-10-06 08:52 AM, Peter Lind wrote: Where exactly do you get the part about double quotes from? Can't seem to locate it in the any of the relevant specs (xhtml or xml). Also, never seen an xml or xhtml validator

Re: [PHP] which one is faster

2010-10-06 Thread Andy McKenzie
On Wed, Oct 6, 2010 at 9:25 AM, Peter Lind peter.e.l...@gmail.com wrote: On 6 October 2010 15:21, Andy McKenzie amckenz...@gmail.com wrote: On Wed, Oct 6, 2010 at 9:03 AM, Robert Cummings rob...@interjinn.com wrote: On 10-10-06 08:52 AM, Peter Lind wrote: Where exactly do you get the part

Re: [PHP] which one is faster

2010-10-06 Thread Peter Lind
On 6 October 2010 15:31, Andy McKenzie amckenz...@gmail.com wrote: *snip* Double quotes are the only example given:  in most documentation if there are two allowed forms, there are two examples, or at least a note in the text.  I haven't read enough of this particular document to know if

Re: [PHP] which one is faster

2010-10-06 Thread Steve Staples
On Wed, 2010-10-06 at 15:43 +0200, Peter Lind wrote: On 6 October 2010 15:31, Andy McKenzie amckenz...@gmail.com wrote: *snip* Double quotes are the only example given: in most documentation if there are two allowed forms, there are two examples, or at least a note in the text. I

Re: [PHP] which one is faster

2010-10-05 Thread chris h
Benchmark and find out! :) What are you using this for? Unless you are doing something crazy it probably doesn't matter, and you should pick whichever you feel looks nicer / is easier to code in / etc. Chris H. On Tue, Oct 5, 2010 at 3:23 PM, saeed ahmed saeed@gmail.com wrote: $a = 'hey';

Re: [PHP] which one is faster

2010-10-05 Thread Ashley Sheridan
On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out! :) What are you using this for? Unless you are doing something crazy it probably doesn't matter, and you should pick whichever you feel looks nicer / is easier to code in / etc. Chris H. On Tue, Oct 5, 2010 at

Re: [PHP] which one is faster

2010-10-05 Thread chris h
Saeed here's a quick (and dirty) test I ran: $tests = 100; $start = microtime(true); for ($i=0; $i$tests; $i++) { $a = md5( rand() ); $b = md5( rand() ); $c = $a.$b; } var_dump( By concat op:\t. (microtime(true) - $start) ); $start = microtime(true); for ($i=0; $i$tests; $i++) {

Re: [PHP] which one is faster

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out! :) What are you using this for? Unless you are doing something crazy it probably doesn't matter, and you should pick whichever you feel looks nicer / is

Re: [PHP] which one is faster

2010-10-05 Thread Ashley Sheridan
On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out! :) What are you using this for? Unless you are doing something crazy it probably doesn't

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:53 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out! :)

Re: [PHP] which one is faster

2010-10-05 Thread TR Shaw
On Oct 5, 2010, at 3:23 PM, saeed ahmed wrote: $a = 'hey'; $b = 'done'; $c = $a.$b; $c = $a$b; which one is faster for echo $c. Depends upon the platform its running on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] which one is faster

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out! :) What are you using this

Re: [PHP] which one is faster

2010-10-05 Thread Ashley Sheridan
On Tue, 2010-10-05 at 15:58 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote:

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:58 PM, Steve Staples sstap...@mnsi.net wrote: On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h