Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79787 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22147 invoked from network); 17 Dec 2014 17:46:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2014 17:46:31 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.177 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.177 mail-pd0-f177.google.com Received: from [209.85.192.177] ([209.85.192.177:60641] helo=mail-pd0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/C3-34025-671C1945 for ; Wed, 17 Dec 2014 12:46:31 -0500 Received: by mail-pd0-f177.google.com with SMTP id ft15so16526997pdb.36 for ; Wed, 17 Dec 2014 09:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=vtZvjM7uGa+FyLD4E1j6RQ6w+FpKRaTusOqtouNPPdo=; b=PYhUilmAB3fBZM2uSYwLfGus5eaEH4DGwwANy8DQFppR8CA9EtOgEDpI37GOAblOw/ aQQxwr+kLqvWjAweluPQRyL5CkkL59XWf5wUA+5X4u3VOCOZm7QmHtnco7H0MOHpv3rf YVEu+hHvoWXaRgrJ82CKM9OfML7SUZVdpxC56ASWpLvTCakLejn4Cga5TpXIWjPC8bbH w8Wy8+fS0SNrDqUkTdugH07gKIR4kWPfEW0y8eXyZ1Q6r0YTzneN0j/biV4GZt5FWk1O YbBjMzH/MiU0tYyoff+eUO+vEWL9Jxwb5CHsZwLOf0iH8OEttaMZHVBPAd+nkwx7psxq SSWQ== X-Received: by 10.66.66.68 with SMTP id d4mr69458516pat.79.1418838387885; Wed, 17 Dec 2014 09:46:27 -0800 (PST) Received: from stas-air.corp.wikimedia.org (tan4.corp.wikimedia.org. [198.73.209.4]) by mx.google.com with ESMTPSA id dk5sm4554616pbc.9.2014.12.17.09.46.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Dec 2014 09:46:27 -0800 (PST) Message-ID: <5491B77A.4020004@gmail.com> Date: Wed, 17 Dec 2014 09:03:54 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Etienne Kneuss , "guilhermeblanco@gmail.com" , Derick Rethans CC: PHP Internals References: <548FEE87.7020602@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > As I said in the original discussion: this RFC is actually about having > an implicit call to __hash() whenever an object is used as an array key. > You can achieve exactly the same in userland with an explicit call. It's like nobody have ever seen __toString before... Of course you can do that 10-line boilerplate that Rowan outlined. The whole point of this RFC is so you don't have to do the boilerplate. > I would rather wait (maybe indefinitely) to have a proper implementation > of objects as keys than have this compromise. I have hard time to understand this - it's like somebody offering to give you $100, with no conditions, and you say "no, I'd rather wait for somebody giving me a billion dollars, until then I won't take the $100". Having object as keys does not contradict this RFC in any way - though the probability of it happening in PHP 7 is pretty much nil so you'd have to wait at least several years, but most probably - forever. So you pretty much choosing to have nothing over having something with no upside at all. Why? -- Stas Malyshev smalyshev@gmail.com