Hi Gwynne, all,

I think this "parsing variables within strings..." note should be removed,
as it's incorrect/misleading as far as I can tell.

First, I was never able to repeat the behavior with the code in the bug
report months ago, nor am I now (no matter what I try).  Second, and more
importantly, using concatenation (.) creates the *exact same* temporary
variables as interpolated strings (well, meaning the temp var that's used
for assignment or such), contrary to what Ilia said in the bug report, as
far as I know.  This is obvious in the code (and I had been working in that
area recently ;-)).

So unless someone can explain WHY the memory usage could be different, the
note should definitely be reverted, since there's nothing to be concerned
about.


Thanks,
Matt


----- Original Message ----- 
From: "Gwynne Amaya Raskind"
Sent: Thursday, June 14, 2007 8:20 PM
Subject: [PHP-DOC] cvs: phpdoc /en/language types.xml

> gwynne Fri Jun 15 01:20:55 2007 UTC
>
>   Modified files:
>     /phpdoc/en/language types.xml
>   Log:
>   - Fix small grammatical error
>   - Document memory usage for parsed variables (fixes bug #40122)
>
>
>
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/types.xml?r1=1.179&r2=1.180&diff_format=u
> Index: phpdoc/en/language/types.xml
> diff -u phpdoc/en/language/types.xml:1.179
phpdoc/en/language/types.xml:1.180
> --- phpdoc/en/language/types.xml:1.179 Thu May 24 18:46:00 2007
> +++ phpdoc/en/language/types.xml Fri Jun 15 01:20:55 2007
[...]
> +       <para>
> +        Parsing variables within strings uses more memory than string
> +        concatenation. When writing a PHP script in which memory usage is
a
> +        concern, consider using the concatenation operator (.) rather
than
> +        variable parsing.
>         </para>

Reply via email to