Bug #68278 [NEW]: RecursiveIteratorIterator fails when passed an IteratorAggregate

From: Date: Tue, 21 Oct 2014 14:54:51 +0000
Subject: Bug #68278 [NEW]: RecursiveIteratorIterator fails when passed an IteratorAggregate
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188229@lists.php.net to get a copy of this message
From: chuck at manchuck dot com Operating system: windows/*nix PHP version: 5.5.18 Package: SPL related Bug Type: Bug Bug description:RecursiveIteratorIterator fails when passed an IteratorAggregate Description: ------------ When RecursiveIteratorIterator is given an IteratorAggregate, a fatal exception is thrown. Test script: --------------- class IteratorBug implements IteratorAggregate { public function getIterator() { return new ArrayIterator([]); } } $iterator = new RecursiveIteratorIterator(new IteratorBug()); Expected result: ---------------- a RecursiveIteratorIterator is created Actual result: -------------- Fatal error: Uncaught exception 'InvalidArgumentException' with message 'An instance of RecursiveIterator or IteratorAggregate creating it is required' in /var/www/sando/bin/iteratorBug.php on line 11 InvalidArgumentException: An instance of RecursiveIterator or IteratorAggregate creating it is required in /var/www/sando/bin/iteratorBug.php on line 11 -- Edit bug report at https://bugs.php.net/bug.php?id=68278&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68278&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68278&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68278&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68278&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68278&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68278&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68278&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68278&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68278&r=support Expected behavior: https://bugs.php.net/fix.php?id=68278&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68278&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68278&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68278&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68278&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68278&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68278&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68278&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68278&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68278&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68278&r=mysqlcfg

« previous php.bugs (#188229) next »