#37149 [Opn->Bgs]: is_array doesn't return TRUE on ArrayObject
| From: | helly@php.net | Date: | Thu, 20 Apr 2006 19:03:50 +0000 |
| Subject: | #37149 [Opn->Bgs]: is_array doesn't return TRUE on ArrayObject | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96051@lists.php.net to get a copy of this message | ||
ID: 37149
Updated by: helly@php.net
Reported By: troelskn at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: *
PHP Version: *
Assigned To: helly
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
doesn't matter, you still cannot use it in array functions
Previous Comments:
------------------------------------------------------------------------
[2006-04-20 18:43:08] troelskn at gmail dot com
I has the interface of an array. Thus, in a logical sense it _is_ an
array.
Changed the category to "Feature/Change Request".
------------------------------------------------------------------------
[2006-04-20 18:18:30] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
it is an object not an array, use "instanceof ArrayAccess"
------------------------------------------------------------------------
[2006-04-20 16:14:44] troelskn at gmail dot com
Description:
------------
Using is_array() on an instance of ArrayObject returns FALSE. While
strictly speaking this is true, it would make sense to return TRUE in
most application-level code.
Expected result:
----------------
A solution could be to add an argument to is_array, which relaxes the
check to include ArrayObject. Eg. :
bool is_array ( mixed var, [bool strict] )
$obj = new ArrayObject();
is_array($obj, FALSE); // returns TRUE
is_array($obj); // returns FALSE
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37149&edit=1