Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79792 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38201 invoked from network); 17 Dec 2014 20:37:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2014 20:37:51 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:59974] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/00-38128-D99E1945 for ; Wed, 17 Dec 2014 15:37:50 -0500 Received: by mail-wg0-f54.google.com with SMTP id l2so21476879wgh.41 for ; Wed, 17 Dec 2014 12:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=deQ0geeVwYTFIMfOTk3Xy3U/5eohwCLamMnQf1utWMA=; b=B87vynuaulvwPUXDAscAw0C9vMynvcCAg+N4M5yuQHv/VnGfVaD5WyOB5n91/qs7Ea oS6tbGl5QKpPfi+hG7JxQidYg0He7f9GPUt7XXWSOo7WSV8ttyJ0xqcKCR6zUJ2dLXC6 dNqeZrYoTSuN+h8uj0j3EbJbOEZJnd+Aza/UbqNnFnQaxBOGf2xKEyXOyrzCwPc1bxC7 v7g+ThNUT6H4WCGKXVuiVy8rWoPtrjyCzLEwB8KmwfDmcG7ruYt98iASFwMgQvtF4ajl feH5snjo7T4ci/CptSDOG2T0ugQCWVJQ4wwWK2POa1fnf514R7HzOuvVgK6KPvJozqv3 /qVg== MIME-Version: 1.0 X-Received: by 10.180.100.98 with SMTP id ex2mr17991850wib.58.1418848665874; Wed, 17 Dec 2014 12:37:45 -0800 (PST) Received: by 10.216.50.139 with HTTP; Wed, 17 Dec 2014 12:37:45 -0800 (PST) In-Reply-To: <548FEE87.7020602@gmail.com> References: <548FEE87.7020602@gmail.com> Date: Wed, 17 Dec 2014 20:37:45 +0000 Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: leight@gmail.com (Leigh) On 16 December 2014 at 08:34, Stanislav Malyshev wrote: > Hi! > > I'd like to initiate a vote on "objects as keys" RFC: > https://wiki.php.net/rfc/objkey > > I know this is a holiday season but it was extensively discussed and I > think most people already formed their opinions. I've put the voting > period as 3 weeks to have some time for people to vote even with the > holidays, etc. > > The vote includes choice for the name. Vote for either name is counted > as the vote for the overall proposal, and 2/3 majority is required as > it's a language change. > > Some more expanded summary of the arguments is here: > http://php100.wordpress.com/2014/12/14/objects-as-keys/ in case you're > interested. I've not read the whole email thread, but I have read the RFC, sorry if I missed something in the emails. I've voted no, I really don't see any benefit to automatically calling a magic method for a key, this is a kind of unintuitive magic for me. For objects as keys to be useful (in my opinion), a foreach loop or array_search must be able to return the object as the key component. The RFC doesn't offer a way to retrieve the original object from the stored hash, indeed without a refcount++ the object may not even exist any more. I honestly like the idea of "objects as keys", but this RFC doesn't offer that.