|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-17 23:26 UTC] jani@php.net
[2007-11-05 21:24 UTC] stas@php.net
[2007-11-05 21:42 UTC] hannes dot magnusson at gmail dot com
[2007-12-28 14:14 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 09:00:01 2025 UTC |
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 ===