ID: 40122 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Mac OS X 10.4.8 PHP Version: 5.2.1RC2 New Comment:
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2007-01-14 22:12:36] [EMAIL PROTECTED] So if one should write a daemon or anything else with a bit longer life span and/or heavy I/O, she'd better avoid using parsed expressions inside strings? Even though it's not a big deal, I still think it should be stated somewhere. ------------------------------------------------------------------------ [2007-01-14 15:03:04] [EMAIL PROTECTED] The first loop creates temp vars and those are not freed until the script finished execution. ------------------------------------------------------------------------ [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