php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46317 Error handling in ArrayObject constructor
Submitted: 2008-10-16 16:01 UTC Modified: 2008-10-19 18:00 UTC
From: zoe dot slattery at googlemail dot com Assigned: colder (profile)
Status: Closed Package: SPL related
PHP Version: 5.3CVS-2008-10-16 (snap) OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zoe dot slattery at googlemail dot com
New email:
PHP Version: OS:

 

 [2008-10-16 16:01 UTC] zoe dot slattery at googlemail dot com
Description:
------------
Errors are in the ArrayObject constructor are handled differently between PHP53 and PHP6. I believe that the PHP6 behaviour is better.

Reproduce code:
---------------
The test case is here:http://www.pastebin.ca/1228409

Expected result:
----------------
The PHP53 result is in the --EXPECT-- section of the test case.



Actual result:
--------------
The actual result on PHP6 is:

Bad iterator type:
ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'Exception' given(6)
Non-existent class:
ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClassName' given(13)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-17 14:47 UTC] zoe dot slattery at googlemail dot com
Hi
I committed the tests that relate to this. They currently have an --XFAIL-- section in the PHP 5.2 and PHP5.3 versions of the tests.

The tests are in ext/spl/tests and are called:
arrayObject___construct_error1.phpt
arrayObject_setIteratorClass_error1.phpt

they both reference this bug number.
 [2008-10-19 18:00 UTC] colder@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 08:01:34 2025 UTC