Re: array_key_exists BC break

From: Date: Thu, 06 Nov 2008 21:21:21 +0000
Subject: Re: array_key_exists BC break
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Groups: php.internals 
Request: Send a blank email to internals+get-41740@lists.php.net to get a copy of this message
So allowing passing objects to array stuff using HASH_OF can lead to unexpected behavior. Dropping the old behavior makes this clear ... but is bad for stuff like ArrayObject. I'm not sure whether we should add special rules for a single class though .. johannes
The exception should be made for any class implementing the relevant SPL interfaces, and that's not just ArrayObject. It may be seen as just "one class" but actually all of the "transparent" iterator implementations (for iterating SQL, XML, or whatever data you have) hinge on those interfaces and that class to work as a normal array with the array functions. Regards, Stan Vassilev

« previous php.internals (#41740) next »