ID:               40122
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: Mac OS X 10.4.8
 PHP Version:      5.2.1RC2
 New Comment:

The first loop creates temp vars and those are not freed until the
script finished execution.


Previous Comments:
------------------------------------------------------------------------

[2007-01-13 18:33:52] [EMAIL PROTECTED]

Description:
------------
I'm not sure whether this is intended behaviour, but variable 
parsing inside strings seem to allocate memory, which is not 
freed until script has been executed.

Reproduce code:
---------------
$foo = 'value';
echo "first loop\n";

for ($i = 0; $i < 10; $i++) {
    $bar = "foo: $foo";
    echo memory_get_usage() . "\n";
}

echo "second loop\n";

for ($i = 0; $i < 10; $i++) {
    $bar = 'foo: ' . $foo;
    echo memory_get_usage() . "\n";
}

Expected result:
----------------
first loop
52280
52280
...
52280
52280
second loop
52516
52516
...
52516
52516

Actual result:
--------------
first loop
52280
52304
52328
52352
52376
52400
52424
52448
52472
52496
second loop
52516
52516
...
52516
52516



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40122&edit=1

Reply via email to