On Fri, 2008-10-24 at 13:15 +0400, Alexey Zakhlestin wrote:
> On Fri, Oct 24, 2008 at 1:05 PM, Ionut Gabriel Stan
> <[EMAIL PROTECTED]> wrote:
> > But wouldn't be useful to at least accept objects implementing ArrayAccess?
> 
> sounds like a good idea to me

nope that would mean that some scripts might work different between 5.2
and 5.3, now one gets an error. consider such a script:

<?php
class Foo extends ArrayAccess {
    public $prop = 42;
    function offsetGet($n) { ... }
    ....
}

$o = new foo;
array_key_Exists('prop', $o);
?>

In <= 5.2 it will return the value of $o->prop, in 5.3 it would call the
offsetGet() method. 

I prefer an error, if many people want the old behavior that's fine to
me, but don't change it.

btw. this also affects quite a few other functions: next/current/key/...
at least ... and maybe more after using the "new" parameter parsing API.

johannes



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to