ID: 49906 Comment by: marek at flaber dot net Reported By: marc-bennewitz at arcor dot de Status: Open Bug Type: SPL related Operating System: Linux PHP Version: 5.3SVN-2009-10-16 (snap) New Comment:
When you actually trying to rewind the object it is making php to segfault. Like here: $limitit = unserialize( serialize($limitit) ); echo $limitit->next(); var_dump($limitit->getInnerIterator()); Previous Comments: ------------------------------------------------------------------------ [2009-10-16 23:59:45] marc-bennewitz at arcor dot de 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 this bug report at http://bugs.php.net/?id=49906&edit=1