On 08/06/2010 04:42 PM, Gustavo Lopes wrote:
On Fri, 06 Aug 2010 15:33:18 +0100, mathieu.suen <mathieu.s...@easyflirt.com> wrote:

Hi,

For now you can only index an array using a scalar type or a string.
Is there some rfc or work going on to enlarge the possibility so that it
is possible to have some other object like:

- closure
- object
- etc.

I think the problem with that is how you are going to generate the hash of arbitrary objects in order to store them in the hash table. It's not like all PHP objects have a hashCode() method.

IMHO It should.


So the only plausible option would be to attribute the same hash to all and the test all for equality on an insertion with a new key or in the worst case scenario for updates and reads.


Since php is not referentially transparent I would rather use identity unless object can redefine equality.

-- Mathieu Suen

        

Reply via email to