Bug #34849 [Nab]: array_key_exists and isset misbehavior with ArrayAccess

From: Date: Mon, 23 Feb 2015 10:26:18 +0000
Subject: Bug #34849 [Nab]: array_key_exists and isset misbehavior with ArrayAccess
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190906@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=34849&edit=1

 ID:                 34849
 Updated by:         yohgaki@php.net
 Reported by:        tschundler at gmail dot com
 Summary:            array_key_exists and isset misbehavior with
                     ArrayAccess
 Status:             Not a bug
 Type:               Bug
 Package:            Arrays related
 Operating System:   *
 PHP Version:        5.*
 Block user comment: N
 Private report:     N

 New Comment:

thomas, you should file new bug record for a feature request. 
Please search bug DB before creating new one.


Previous Comments:
------------------------------------------------------------------------
[2015-02-23 08:51:56] thomas at gielfeldt dot dk

Could we create a new interface, e.g. ArrayAccessExtended, to implement the remaining array
functionality?

------------------------------------------------------------------------
[2011-07-12 09:11:21] arpad@php.net

To clarify, objects do work with some array_* functions like array_key_exists() and array_walk(),
but using the hashtable of the object's properties.

Changing these functions to use the ArrayAccess (and Traversable etc.) interface when present is
possible but would be a BC break.

------------------------------------------------------------------------
[2011-07-11 14:20:07] jon at phpsitesolutions dot com

BTW, that tidbit (array_* functions are not compatible with ArrayAccess) is not 
mentioned in the manual, which makes it pointless to point the bug reporter to 
the manual.

And no, I'm not submitting a bug request for that change to be added, as I'm not 
the person that:
- pointed the reporter back to the manual
- noted that array_* functions are incompatible

Seems the bug request should be on that person in that case.

------------------------------------------------------------------------
[2011-07-11 14:17:11] jon at phpsitesolutions dot com

That's ridiculous, that ArrayAccess doesn't work with PHP's own array_* 
functions.
If that's the case, why provide ArrayAccess as an SPL class?
You'd think that SPL classes would have full functionality with native PHP, yet 
because someone was apparently lazy during implementation, it doesn't.

And so of course, 6 years later, this is still an issue that has not been 
rectified.

Now I see why PHP has such a bad reputation when compared against other quality 
languages...

------------------------------------------------------------------------
[2005-10-13 08:24:01] 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

ArrayAccess objects don't work in array_*() functions. You may want to turn this report into a
feature request?

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=34849


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


Thread (7 messages)

« previous php.bugs (#190906) next »