Edit report at https://bugs.php.net/bug.php?id=62629&edit=1
ID: 62629 Updated by: larue...@php.net Reported by: zoeslam at gmail dot com Summary: IteratorIterator doesn't delegate count() method Status: Open Type: Bug Package: SPL related Operating System: Ubuntu 12.04 PHP Version: 5.4.5 -Assigned To: +Assigned To: colder Block user comment: N Private report: N New Comment: yeah, the reason should be the same. Previous Comments: ------------------------------------------------------------------------ [2012-07-21 08:29:44] zoeslam at gmail dot com Description: ------------ This bug report MAY be similar to: https://bugs.php.net/bug.php?id=62616 But behave differently Test script: --------------- class MyFile extends SplFileObject { private $x = 10; private $y = 20; public function setX($x) { $this->x = $x; } public function setY($y) { $this->y = $y; } public function getX() { return $this->x; } public function count() { return $this->y; } } $myFile = new MyFile(__FILE__); var_dump($myFile->getX()); var_dump($myFile->count()); $myFile->setX(15); $myFile->setY(25); var_dump($myFile->getX()); var_dump($myFile->count()); $ii = new IteratorIterator($myFile); var_dump($ii->getX()); var_dump($ii->count()); Expected result: ---------------- int(10) int(20) int(15) int(25) int(15) int(25) Actual result: -------------- int(10) int(20) int(15) int(25) int(15) Notice: Undefined property: IteratorIterator::$y in /tmp/it.php on line 12 NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62629&edit=1