ID: 44793 User updated by: matthew at zend dot com Reported By: matthew at zend dot com Status: Bogus Bug Type: SPL related Operating System: Linux (Ubuntu) PHP Version: 5.2.5 New Comment:
This is a bug in SPL, which is bundled in PHP core; additionally, it exposes a potential issue with how inheritence is resolved in the language. Please re-open. Previous Comments: ------------------------------------------------------------------------ [2008-04-21 15:51:24] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. class ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable. Traversable is not the same as Iterator: Traversable allows an object to be magically iterated by, i.e foreach, while Iterator explicitly provides userland iteration interface through next/valid/current/key/rewind. ------------------------------------------------------------------------ [2008-04-21 12:52:27] matthew at zend dot com Description: ------------ ArrayObject extends ArrayAccess, which implements ArrayIterator and in turn Iterator. However, when checking to see if a concrete instance of ArrayObject implements Iterator, the return is false. Reproduce code: --------------- $o = new ArrayObject(array()); if ($o instanceof Iterator) { echo "Instance of Iterator"; } else { echo "Failed"; } Expected result: ---------------- Instance of Iterator Actual result: -------------- Failed ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44793&edit=1