#49906 [NEW]: LimitIterator doesn't work with un-/serialize

From: Date: Fri, 16 Oct 2009 23:59:46 +0000
Subject: #49906 [NEW]: LimitIterator doesn't work with un-/serialize
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143648@lists.php.net to get a copy of this message
From:             marc-bennewitz at arcor dot de
Operating system: Linux
PHP version:      5.3SVN-2009-10-16 (snap)
PHP Bug Type:     SPL related
Bug description:  LimitIterator doesn't work with un-/serialize

Description:
------------
Serializing of LimitIterator doesn't work.


Reproduce code:
---------------
$it = new ArrayIterator(array('test' => 'test'));

$limitit = new LimitIterator($it, 0, 10);
var_dump($limitit);
var_dump($limitit->getInnerIterator());

$limititSer = serialize($limitit);
var_dump($limititSer);

$limitit = unserialize($limititSer);
var_dump($limitit);
var_dump($limitit->getInnerIterator());

Expected result:
----------------
object(LimitIterator)#2 (0) {
  /* some content */
}
object(ArrayIterator)#1 (1) {
  ["storage":"ArrayIterator":private]=>
  array(1) {
    ["test"]=>
    string(4) "test"
  }
}
string(25) "O:13:"LimitIterator":0:{...........}"
object(LimitIterator)#3 (0) {
  /* some content */
}
object(ArrayIterator)#1 (1) {
  ["storage":"ArrayIterator":private]=>
  array(1) {
    ["test"]=>
    string(4) "test"
  }
}

Actual result:
--------------
object(LimitIterator)#2 (0) {
}
object(ArrayIterator)#1 (1) {
  ["storage":"ArrayIterator":private]=>
  array(1) {
    ["test"]=>
    string(4) "test"
  }
}
string(25) "O:13:"LimitIterator":0:{}"
object(LimitIterator)#3 (0) {
}
NULL

-- 
Edit bug report at http://bugs.php.net/?id=49906&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=49906&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=49906&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=49906&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=49906&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49906&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=49906&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=49906&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=49906&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=49906&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=49906&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=49906&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=49906&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=49906&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=49906&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49906&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49906&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=49906&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=49906&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=49906&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=49906&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=49906&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#143648) next »