Re: array_key_exists BC break
| From: | Stanislav Malyshev | Date: | Thu, 20 Nov 2008 23:52:30 +0000 |
| Subject: | Re: array_key_exists BC break | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-42000@lists.php.net to get a copy of this message | ||
Hi!
. end . prev . next . reset . current . keyI think those should be more friendly with Iterators, but for other objects probably not much sense to allow it. In 5.2 they modify or use current hash pointer, but for objects that doesn't make too much sense.
. array_key_existsHere it may make some sense, though I guess it should maybe go through more specific handlers (i.e. has_dimension or has_property?). Also, feels weird that key_exists works but in_array doesn't.
. array_unique . array_flip . array_walk_recursive . array_walkThose are ok with any object, in theory, though it's not clear why you could do array_flip on object but not array_reverse or array_keys/values. Maybe we should not have object support from those, except array_walk_* for Iterators? If you want something else, get properties manually...
. uksort . uasort . usort . natcasesort . natsortThese frankly make little sense with objects and also other sorts do not support object, so I'd say this is just a bug that they allow objects at all. Any comments? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com