Re: [RFC][VOTE] Objects as Keys

From: Date: Wed, 17 Dec 2014 01:32:09 +0000
Subject: Re: [RFC][VOTE] Objects as Keys
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-79762@lists.php.net to get a copy of this message
Hi! > AIUI, this RFC is meant to introduce some sugar only. Wouldn't it be I'm not sure what you mean by "some sugar only". It introduces the capability of using objects in array key context, which was not available until now. > possible to have object hashes without __hash(), by introducing a > respective interface (maybe "Hashable" or "Identifiable") and requiring > the appropriate classes to implement this interface? It's possible and essentially the same, replacing magic method (which is how things were done in PHP since forever until now) with interface - which probably would be slower to check, would still require dedicated method name, probably starting with __, and will essentially do the same. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#79762) next »