Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78362 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79617 invoked from network); 27 Oct 2014 02:23:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2014 02:23:26 -0000 Authentication-Results: pb1.pair.com header.from=will@fitch.so; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=will@fitch.so; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain fitch.so designates 66.111.4.25 as permitted sender) X-PHP-List-Original-Sender: will@fitch.so X-Host-Fingerprint: 66.111.4.25 out1-smtp.messagingengine.com Received: from [66.111.4.25] ([66.111.4.25:41978] helo=out1-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/63-56216-C9CAD445 for ; Sun, 26 Oct 2014 21:23:25 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DD359208FB for ; Sun, 26 Oct 2014 22:23:21 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 26 Oct 2014 22:23:21 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fitch.so; h= x-sasl-enc:content-type:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; s= mesmtp; bh=tzmhE7oQ08ifWSD7AvoWwapsQBo=; b=HKomt7V5COf6qDycMp2q7 Tn2AbaxBWzXWLdptuezTtwsn6tFwKydJra4XcxZFtDliuO4+3Oz/XiEWVn8HzH6G csMiCMfoWrkyR/g2ahIpN4oc1rXWXVRUA5gL1ySftAdHnO0UQUjjvL5gRwuPxuwA SDkvYyhJ6Gxe1u43sbinb8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:content-type:mime-version :subject:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; s=smtpout; bh=tzmhE7oQ08ifWSD7AvoWwap sQBo=; b=p8DQciIfodyxgFUAD02VtgyKXSq7NAbqD9M0MZzCeZbXhI+W1o/AkSX 3YKHImZAB0J5Lq8Lr2Z1CNbliulXXq+fKnyBjw+8UPL5WN3Okza6d0cfN0uXINfv ihbdEY0UznobdfLGElpCWmI03ssinOfCb39+2OK5mQt6hzDCfaKM= X-Sasl-enc: +UEfaUKLmbHtz0YxQuTHTsEnSAcwIZX24np1d2bfsT4C 1414376601 Received: from [192.168.1.137] (unknown [24.183.225.156]) by mail.messagingengine.com (Postfix) with ESMTPA id 702ECC00006; Sun, 26 Oct 2014 22:23:21 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <544DA1CD.9070109@php.net> Date: Sun, 26 Oct 2014 21:23:20 -0500 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <544DA1CD.9070109@php.net> To: Stas Malyshev X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: will@fitch.so (Will Fitch) > On Oct 26, 2014, at 8:37 PM, Stas Malyshev = wrote: >=20 > Hi! >=20 > I would like to present to your attention an RFC about using object as = keys: >=20 > https://wiki.php.net/rfc/objkey >=20 Hi Stas! I=E2=80=99m trying to wrap my head around a real-world use-case with = this. We have spl_object_hash, which effectively provides a unique hash = for an object. If the intent is to provide an opportunity of individual = classes to decide what their hash is, couldn=E2=80=99t they provide that = via __toString? I know many frameworks use __toString to build out some = implementation of an object (Zend form for example), but the point of = __toString is to provide a string representation of an object. I want to say, I=E2=80=99m not at all against this - rather I support = it. I=E2=80=99m just looking for the RFC to provide an example that I = and others can relate to. > It was discussed in the past on the list: > http://marc.info/?t=3D141145969600001&r=3D1&w=3D2 > and I think it makes sense to propose a formal RFC for it. Both the = text > and the code in the patch includes bits done by myself and Joe = Watkins. > The patch does not cover 100% of cases but should work for most > reasonable scenarios, if something is wrong or you have ideas how to > make it better please tell. >=20 > The name __hash is not final, I am open to using __toKey instead or = any > reasonable alternative, we may also include a couple of options in the > vote if that will be a point of disagreement. >=20 > Thanks, > Stas >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20