Re: which one is faster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2010-10-06 at 15:43 +0200, Peter Lind wrote:
> On 6 October 2010 15:31, Andy McKenzie <amckenzie4@xxxxxxxxx> 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 form, but I've certainly seen it a lot of
> > places.
> >
> > -Alex
> >
> 
> Xhtml documents are xml documents and thus must follow the specs for
> XML. Specifically, the following:
> http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue
> 
> Regards
> Peter

Wow... I didn't mean to spark up a debate/battle about the use of " vs '
or anything... I was just under the impression that the use of {} when
referring to a variable inside the "" was "proper", and was the way it
"should" be done, not that it "HAD" to be done that way...   even back
in 92 when I started HTML programming, I was taught that elements and
attributes should be in lower case, attributes should be within ""...
and when i started using PHP, I would always use "" and when referencing
a variable, "text ". $var ." more text" was the way I did it, and then i
read somewhere that variable inside "" to avoid any potential issues,
should be enclosed with {}.   Granted, it works without using them (for
99% of things), but as my personal preference, that is the way i do it,
and was under the impression that it should be used in that manner, to
avoid deprecation.

Now, to end my run on and on and on sentence... it was just something I
have always done, just like the code formatting i follow (which i wont
get into, cuz that will prolly start another huge long thread too :P)
--

As for the OP's question, I don't think it really matters which one you
use, it would boil down to which one makes more sense to you when you
read it later and try to figure out why you did it the way you did :)
(documentation is essential for deciphering code the next day)

If you're worried about I/O processes, and have to constrain yourself to
using 1 or 2 more I/O processes, then you should do a lot of
benchmarking to determine for yourself which is more efficient on your
hardware.

again, just my $0.02.


Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux