|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-07-12 08:28 UTC] jpauli@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: jpauli
[2016-07-12 08:28 UTC] jpauli@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Description: ------------ The '@' error suppression operator appears to not work correctly when wrapped by IteratorIterator. The issue occurs when an error is triggered (and supposedly suppressed) in getIterator() in the inner iterator - an InvalidArgumentException is thrown instead. I’ve not tested this in any great detail, or with other iterator types (apologies, time is tight at the moment). Test script: --------------- <?php class CustomIterator implements IteratorAggregate { public function getIterator() { @unlink('/missing/file.txt'); return new ArrayIterator(array('item')); } } $obj = new CustomIterator; $iterator = new IteratorIterator($obj); echo 'done'; Expected result: ---------------- Text 'done' should be shown Actual result: -------------- Fatal error: Uncaught exception 'InvalidArgumentException' with message 'unlink(/missing/file.txt): No such file or directory'