Re: [RFC][VOTE] Objects as Keys

From: Date: Tue, 16 Dec 2014 18:14:27 +0000
Subject: Re: [RFC][VOTE] Objects as Keys
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-79735@lists.php.net to get a copy of this message
Hi! > I was previously in favour of this, but it’d prevent actual indexing No, of course it won't - if we ever introduce indexing objects (which probably will require rewrite of the HashTable, any takers?) it would be very easy to index any object that does not implement __hash without any BC problem, and convert all those implementing __hash to "return $this" if desired. > by objects in future, and I can’t think of any use cases which > aren’t better solved by explicitly converting to a string/integer. There's no implicit conversion, and explicit one is a) inacessible in userspace for anything but string and b) annoying for the same reasons for which __toString exists. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#79735) next »