Bug #74218 [Opn->Csd]: ArrayIterator error message is confusing

From: Date: Fri, 10 Mar 2017 07:18:09 +0000
Subject: Bug #74218 [Opn->Csd]: ArrayIterator error message is confusing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207768@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74218&edit=1 ID: 74218 Updated by: laruence@php.net Reported by: fernando at null-life dot com Summary: ArrayIterator error message is confusing -Status: Open +Status: Closed Type: Bug Package: *General Issues Operating System: * PHP Version: 7.1.2 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=c398198c0a8e58bc37a441bcfbfe1eb0e8058d9f Log: Fixed bug #74218 (ArrayIterator error message is confusing) Previous Comments: ------------------------------------------------------------------------ [2017-03-07 21:02:04] fernando at null-life dot com Same message appears on: $arrayobject = new ArrayObject(0); ------------------------------------------------------------------------ [2017-03-07 20:56:05] fernando at null-life dot com 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 this bug report at https://bugs.php.net/bug.php?id=74218&edit=1

« previous php.bugs (#207768) next »