|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28125 ArrayObject leaks when accessing elements
Submitted: 2004-04-23 16:19 UTC Modified: 2004-04-25 13:14 UTC
From: adam at trachtenberg dot com Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0RC2 OS: *
Private report: No CVE-ID: None
 [2004-04-23 16:19 UTC] adam at trachtenberg dot com
There's a memory leak when accessing an 
ArrayObject using array notation.

Reproduce code:
php -r '$a = new ArrayObject(array("a" => 1)); print $a["a"];'

This only seems to happen to string keys. There is no 
leak when I do:

php -r '$a = new ArrayObject(array("a")); print $a[0];'

Expected result:

Actual result:
1/usr/local/cvs/php-src/Zend/zend_execute.c(3382) :  
Freeing 0x00E14580 
(16 bytes), script=-
=== Total 1 memory leaks detected ===


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-23 20:22 UTC]
Here's a patch to fix the open SPL issues:
It would be nice to have it tested prior to comitting it after RC2.

 [2004-04-25 13:14 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Mar 23 18:01:26 2019 UTC