From:             gms08701 at yahoo dot com
Operating system: FreeBSD 5.3
PHP version:      5.0.3
PHP Bug Type:     SPL related
Bug description:  php in free() error with RecursiveArrayIterator

Description:
------------
Trying to create a RecursiveArrayIterator class, 
using currently available SPL classes.
Its generating this error ->
php in free(): warning: chunk is already free

Apparently it works on win2k ->
http://marc.theaimsgroup.com/?l=php-general&m=110807956115501&w=2

Reproduce code:
---------------
<?php

$array = array(0 => array('world'));

class RecursiveArrayIterator extends ArrayIterator implements
RecursiveIterator {
   function hasChildren() {
       return (is_array($this->current()));
   }

   function getChildren() {
       return new self($this->current());
   }
}

$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
foreach($it as $key => $val) {
   var_dump($key, $val);
}

?>

Expected result:
----------------
$ php -f z.php
int(0)
string(5) "world"

Actual result:
--------------
$ php -f z.php
int(0)
string(5) "world"
php in free(): warning: chunk is already free

-- 
Edit bug report at http://bugs.php.net/?id=31926&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31926&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31926&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31926&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31926&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31926&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31926&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31926&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31926&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31926&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31926&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31926&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31926&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31926&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31926&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31926&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31926&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31926&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31926&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31926&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31926&r=mysqlcfg

Reply via email to