|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-16 11:18 UTC] sniper@php.net
[2004-03-15 10:12 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 18:00:01 2025 UTC |
Description: ------------ It appears that the engine is doing a Copy-on-write when it shouldn't be because the variable is being cast to something else. If that is correct (that might not be the correct bug diagnosis), Not only does this slow everything down since you are doing deep copies when you don't need to be but it leaks like crazy. Reproduce code: --------------- <?php $a = array(1, 2, 3, 4, 5, 6); $b = $a; $b .= "foo"; ?> Expected result: ---------------- Nothing. Actual result: -------------- /home/john/working/php-src/Zend/zend_hash.c(756) : Freeing 0x4045DCB8 (35 bytes), script=array.php /home/john/working/php-src/Zend/zend_hash.c(377) : Actual location (location was relayed) Last leak repeated 5 times /home/john/working/php-src/Zend/zend_execute.c(1718) : Freeing 0x4045DA70 (44 bytes), script=array.php /home/john/working/php-src/Zend/zend_variables.c(148) : Actual location (location was relayed) /home/john/working/php-src/Zend/zend_execute.c(3313) : Freeing 0x4045D878 (16 bytes), script=array.php Last leak repeated 5 times /home/john/working/php-src/Zend/zend_variables.c(149) : Freeing 0x4045E638 (32 bytes), script=array.php /home/john/working/php-src/Zend/zend_hash.c(157) : Actual location (location was relayed) === Total 14 memory leaks detected ===