php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2179 Memory leak in foreach() with a return statement
Submitted: 1999-08-28 09:17 UTC Modified: 1999-09-09 10:16 UTC
From: christophe dot massiot at mail dot dotcom dot fr Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (28/08/1999) OS: LinuxPPC R5/Linux 2.2.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: christophe dot massiot at mail dot dotcom dot fr
New email:
PHP Version: OS:

 

 [1999-08-28 09:17 UTC] christophe dot massiot at mail dot dotcom dot fr
The following script :
<?
function srv_isin($array, $pattern) {
  foreach ($array as $current)
    return;
} //srv_isin

srv_isin(array("meuh"), "meuh");
?>

produces :
15:18 [webase3:pts/11] salome:~/html% php test.php 
Content-Type: text/html

test.php:  Freeing 0x018FF2E8 (4 bytes), allocated in zend_hash.c on line 391<br>
test.php:  Freeing 0x018FF298 (35 bytes), allocated in zend_hash.c on line 380<br>
test.php:  Freeing 0x018FF258 (20 bytes), allocated in zend_hash.c on line 95<br>
test.php:  Freeing 0x018FF200 (44 bytes), allocated in zend_variables.c on line 131<br>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-09 10:16 UTC] andi at cvs dot php dot net
Fixed in the latest CVS.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC