ID:               28099
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wast33d at hotmail dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Class/Object related
-Operating System: Windows XP Pro
+Operating System: *
-PHP Version:      5.0.0RC1
+PHP Version:      5.0.0RC2
-Assigned To:      
+Assigned To:      helly
 New Comment:

Here's a patch to fix the open SPL issues:
http://marcus-boerger.de/php/ext/spl/spl-20040422.diff.txt
It would be nice to have it tested prior to comitting it after RC2.


Previous Comments:
------------------------------------------------------------------------

[2004-04-21 21:38:21] wast33d at hotmail dot com

Description:
------------
It seems that ArrayObject should implement ArrayAccess given that it
already implements Traversable.  For me to know if a given variable can
be accessed with the [] operator, I need to do:

if (is_array($obj) || $obj instanceof ArrayAccess || $obj instanceof
ArrayObject) { }

Reproduce code:
---------------
function array_check($obj) {
        if (is_array($obj)) {
                print "Is an array()<br />\n";
        }
        if ($obj instanceof ArrayAccess) {
                print "Implements ArrayAccess<br />\n";
        }
        if ($obj instanceof ArrayObject) {
                print "Is an instance of ArrayObject<br />\n";
        }
}

array_check(new ArrayObject(array()));

Expected result:
----------------
Implements ArrayAccess
Is an instance of ArrayObject

Actual result:
--------------
Is an instance of ArrayObject


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28099&edit=1

Reply via email to