|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27376 Array recrusion make Memory leak
Submitted: 2004-02-24 08:03 UTC Modified: 2004-02-24 14:10 UTC
From: rxk at gmx dot de Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.4 OS: win2000/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rxk at gmx dot de
New email:
PHP Version: OS:


 [2004-02-24 08:03 UTC] rxk at gmx dot de
unset don't free the memory.

Reproduce code:

for($j=0;$j<5;$j++) {
	for($i=0;$i<20000;$i++) {
		$a[$i] = array(1,2,3,4,5);
		$a[$i][] = &$a[$i];

	echo "before unset\n";sleep(5);
	echo "after unset\n";sleep(5);

Actual result:
There is none differentiated before or after unset.
The memory overflows.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-24 08:40 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Infinite recursion like this is always leaking. Don\'t you think your example is pretty dumb anyway? :)
 [2004-02-24 14:10 UTC] rxk at gmx dot de
I don't think this example ist pretty. But this ist a Problem for me. The class phpxpath ( use recursive arrays. I will to use the class in a shell-script-daemon but with thge "bug" is this not possibly!
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 18 07:05:45 2022 UTC