ID:               27275
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Zend Engine 2 problem
 Operating System: RH8
 PHP Version:      5CVS-2004-02-16 (dev)
 New Comment:

This happens with PHP 4 too, so it's nothing new..




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

[2004-02-16 07:38:48] [EMAIL PROTECTED]

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 ===


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


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

Reply via email to