|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-14 15:03 UTC] iliaa@php.net
[2007-01-14 22:12 UTC] spheroid@php.net
[2007-06-15 01:21 UTC] gwynne@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 22:00:01 2025 UTC |
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