php.net |  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
Description:
------------
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:
----------------
1

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-23 20:22 UTC] helly@php.net
Here's a patch to fix the open SPL issues:
http://marcus-boerger.de/php/ext/spl/spl-20040422.diff.txt
It would be nice to have it tested prior to comitting it after RC2.

 [2004-04-25 13:14 UTC] helly@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC