ID:               41115
 Updated by:       [EMAIL PROTECTED]
 Reported By:      hannes dot magnusson at gmail dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Scripting Engine problem
-Operating System: FreeBSD
+Operating System: *
 PHP Version:      5CVS-2007-04-17 (CVS)
-Assigned To:      
+Assigned To:      stas
 New Comment:

Stas, you seem to have added the code where the leak emits from.. :)


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

[2007-04-17 12:08:28] hannes dot magnusson at gmail dot com

Description:
------------
Creating an object from an empty value on overloaded element leaks.

Reproduce code:
---------------
<?php
class foo implements ArrayAccess {
        private $array;
        public function offsetSet($key, $value) {
                $this->array[$key] = $value;
        }
        public function offsetGet($key) {
                return $this->array[$key];
        }
        public function offsetExists($key) {}
        public function offsetUnset($key) {}
}
$foo = new foo;

$foo["bar"] = array();
$foo["bar"][0]->std = "foo";



Actual result:
--------------
Notice: Indirect modification of overloaded element of foo has no
effect in /usr/home/bjori/test/memleak.php on line 16

Strict Standards: Creating default object from empty value in
/usr/home/bjori/test/memleak.php on line 16
[Tue Apr 17 14:02:54 2007]  Script:  'memleak.php'
/usr/src/php/5.2/Zend/zend_execute.c(441) :  Freeing 0x0850535C (16
bytes), script=memleak.php
=== Total 1 memory leaks detected ===



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


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

Reply via email to