Bug #74218 [NEW]: ArrayIterator error message is confusing

From: Date: Tue, 07 Mar 2017 20:56:09 +0000
Subject: Bug #74218 [NEW]: ArrayIterator error message is confusing
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207728@lists.php.net to get a copy of this message
From: fernando at null-life dot com Operating system: * PHP version: 7.1.2 Package: *General Issues Bug Type: Bug Bug description:ArrayIterator error message is confusing Description: ------------ The error message claims that an empty array will be used because an invalid argument was supplied, however the script will actually die because of a Fatal Error. Test script: --------------- <?php $x = new ArrayIterator('.'); echo "here"; Expected result: ---------------- php.exe x.php Fatal error: Uncaught InvalidArgumentException: Passed variable is not an array or object in x\x.php:3 Stack trace: #0 x\x.php(3): ArrayIterator->__construct('.') #1 {main} thrown in x\x.php on line 3 Actual result: -------------- php.exe x.php Fatal error: Uncaught InvalidArgumentException: Passed variable is not an array or object, using empty array instead in x\x.php:3 Stack trace: #0 x\x.php(3): ArrayIterator->__construct('.') #1 {main} thrown in x\x.php on line 3 -- Edit bug report at https://bugs.php.net/bug.php?id=74218&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74218&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74218&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74218&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74218&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74218&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74218&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74218&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74218&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74218&r=support Expected behavior: https://bugs.php.net/fix.php?id=74218&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74218&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74218&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74218&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74218&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74218&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74218&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74218&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74218&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74218&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74218&r=mysqlcfg

« previous php.bugs (#207728) next »