Re: PHP textbook suggestions?
| From: | Robert Cummings | Date: | Thu, 12 Apr 2007 03:51:52 +0000 |
| Subject: | Re: PHP textbook suggestions? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252695@lists.php.net to get a copy of this message | ||
On Wed, 2007-04-11 at 22:47 -0500, Richard Lynch wrote:
> On Tue, April 10, 2007 9:40 pm, Robert Cummings wrote:
> >> echo "The cost is ", $cost;
> >
> > -1 Improper use of double quotes when nothing interpolated.
>
> Yeah, I used to believe in that Urban Legend, and even promulgated it,
> once upon a time.
>
> Then Rasmus set me straight that it's not really any faster/slower,
> and the only difference is whatever is more convenient, if you don't
> need anything interpolated.
>
> Remember that '' examine each character in turn to detect \' and \\
>
> It is the same order of magnitude search, with a slightly smaller
> constant number of patterns to find.
>
> I actually do often use '' if there is nothing to interpolate, for
> longer strings especially, so that the reader (me) knows that there is
> nothing being interpolated.
>
> But on a short enough string, it just doesn't matter which is used.
I meant the -1 in jest ;) While I do promulgate proper use of quotes, I
do so mostly because it provides better clarity of intent... as you have
stated above.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'