Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79762 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31942 invoked from network); 17 Dec 2014 01:32:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2014 01:32:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.182 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.214.182 mail-ob0-f182.google.com Received: from [209.85.214.182] ([209.85.214.182:55101] helo=mail-ob0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/01-25720-E1DD0945 for ; Tue, 16 Dec 2014 20:32:15 -0500 Received: by mail-ob0-f182.google.com with SMTP id wo20so1492497obc.13 for ; Tue, 16 Dec 2014 17:32:12 -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=kM1008K3CtTE3I02L4gzYY3yIuQnDg1St7/gG5SMFvM=; b=fI7VW98teLp4ORKKezywmWgJYruZxpJk4SFUIgdtWRCtIPKMKQ5WuvK9wu+Lq8QLtf nF61vQf6NRVA/ey1/iC/9FnOg3ErKWOy5gVmvwBvRDOcd/T2IbIlvPu3kY+5dFX/g4X6 w0FC98n1cf/DPs8Ihi6A7NimzXmeFDve5s5XfEJUEC7WR6dNvmnCCnRvSCRbgxryj5wz 8iAOlKy7XKvzh94yvnaP+Qx9IehXL/3GqQ+YgUBl4GDxz6VKfuErrj97dr+epFuQwNcT 5dm9jgPF/E6zMf/SRdAlDUcs8WDVAnGwTS6b+kJkHJiqmGIcGbWFFolJIpaYLfvMq8d0 VjAQ== X-Received: by 10.60.98.36 with SMTP id ef4mr24394895oeb.51.1418779932186; Tue, 16 Dec 2014 17:32:12 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id j7sm1154251obw.1.2014.12.16.17.32.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 17:32:11 -0800 (PST) Message-ID: <5490DD19.2080502@gmail.com> Date: Tue, 16 Dec 2014 17:32:09 -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: Christoph Becker , "guilhermeblanco@gmail.com" , Rowan Collins CC: PHP internals References: <548FEE87.7020602@gmail.com> <549009EE.7040808@fischer.name> <54907683.2070509@gmail.com> <8AB6896C-D5DB-4471-BBD5-60784B2FC1BE@gmail.com> <54907EDE.6020500@gmail.com> <4E4F7392-154C-4282-8D5D-553194D09DCE@gmail.com> <5490DC22.2080605@gmx.de> In-Reply-To: <5490DC22.2080605@gmx.de> 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! > 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