From:             [EMAIL PROTECTED]
Operating system: FreeBSD6
PHP version:      5CVS-2006-03-28 (CVS)
PHP Bug Type:     Scripting Engine problem
Bug description:  __set() leaks memory

Description:
------------
__set() seems to leak memory when extending internal classes
(DOMElement for instance)

Reproduce code:
---------------
<?php
    class foo extends DOMElement {
        private $a = array();
        public function __construct() {
        }
        public function __set($k, $v) {
            $this->a[$k] = $v;
        }

    }
    $obj = new foo;
    $obj->foo = "bar";


Actual result:
--------------
[Tue Mar 28 21:45:10 2006]  Script:  'element.php'
/usr/src/php51/Zend/zend_object_handlers.c(292) :  Freeing 0x08320364 (5
bytes), script=element.php
/usr/src/php51/Zend/zend_hash.c(314) : Actual location (location was
relayed)
[Tue Mar 28 21:45:10 2006]  Script:  'element.php'
/usr/src/php51/Zend/zend_hash.c(307) :  Freeing 0x08322B24 (39 bytes),
script=element.php
[Tue Mar 28 21:45:10 2006]  Script:  'element.php'
/usr/src/php51/Zend/zend_object_handlers.c(284) :  Freeing 0x08322AA4 (32
bytes), script=element.php
/usr/src/php51/Zend/zend_hash.c(169) : Actual location (location was
relayed)
[Tue Mar 28 21:45:10 2006]  Script:  'element.php'
/usr/src/php51/Zend/zend_object_handlers.c(283) :  Freeing 0x08322A24 (44
bytes), script=element.php
=== Total 4 memory leaks detected ===

-- 
Edit bug report at http://bugs.php.net/?id=36898&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36898&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36898&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36898&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36898&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36898&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36898&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36898&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36898&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36898&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36898&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36898&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36898&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36898&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36898&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36898&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36898&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36898&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36898&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36898&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36898&r=mysqlcfg

Reply via email to