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 ha

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 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 e

Re: [PHP] which one is faster

2010-10-06 Thread Peter Lind
On 6 October 2010 15:31, Andy McKenzie 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 they follow that f

Re: [PHP] which one is faster

2010-10-06 Thread Andy McKenzie
On Wed, Oct 6, 2010 at 9:25 AM, Peter Lind wrote: > On 6 October 2010 15:21, Andy McKenzie wrote: >> On Wed, Oct 6, 2010 at 9:03 AM, Robert Cummings 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

Re: [PHP] which one is faster

2010-10-06 Thread Andy McKenzie
On Wed, Oct 6, 2010 at 9:03 AM, Robert Cummings 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 choke on sing

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 Cummings 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

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. -- E-M

Re: [PHP] which one is faster

2010-10-06 Thread Peter Lind
On 6 October 2010 14:40, Bob McConnell 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 -04

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

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:58 PM, 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 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 wr

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! :) > > > > > > > > Wha

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 chris h
On Tue, Oct 5, 2010 at 3:53 PM, 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 ar

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 > > > pr

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 nic

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 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, 2

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 wrote: > $a = 'hey'; > $b = 'done'; > >