On 12 January 2011 13:20, Steve Staples <sstap...@mnsi.net> wrote:
> Jim,
>
> Not to be a smart ass like Danial was (which was brilliantly written
> though),  but you have your "example" formatted incorrectly.  You are
> using commas instead of periods for concatenation, and it would have
> thrown an error trying to run your example. :)
>
> # corrected:
> echo "<li><a href=\"index.php?page={$category}\">{$replace}</a></li>";
>
> Steve Staples.

Steve,

The commas are not concatenation. They are separators for the echo construct.

I don't know the internals well enough, but ...

echo $a.$b.$c;

vs

echo $a, $b, $c;

On the surface, the first instance has to create a temporary variable
holding the results of the concatenation before passing it to the echo
construct.

In the second one, the string representations of each variable are
added to the output buffer in order with no need to create a temp var
first.

So, I think for large strings, using commas should be more efficient.

Richard.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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

Reply via email to