Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78396 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73100 invoked from network); 27 Oct 2014 17:32:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2014 17:32:39 -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.220.41 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.41 mail-pa0-f41.google.com Received: from [209.85.220.41] ([209.85.220.41:42300] helo=mail-pa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/43-56216-6B18E445 for ; Mon, 27 Oct 2014 12:32:39 -0500 Received: by mail-pa0-f41.google.com with SMTP id rd3so5944093pab.0 for ; Mon, 27 Oct 2014 10:32:36 -0700 (PDT) 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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=+YZTdmQa1FixIwJ1hbIMRjEuaAojCn6f96LlQKustdk=; b=NhqlUNDwADF/sWw0JRThgKez7ECMQ4Ybp2FKpOqn26qRt4HjWTeERMLmtMoSFykNWo 2IvVNnUrtiggrFUKJIXb2DrhRynidomNCJkcCcMKrsFmNsRVtZgRmz3mqHXENs3iShfb tYRh/G0lUKBsWIdtQmNzkv3OupX+OGsQzn75y7QQYcEGzn6tM+hh84pxj/ok5tp0qxtH Hrg3s6yOAmpBVb6W0Pr2oAq81yNi/EtCdlrQdKQqLw+izpFamwrQWdYA0s50/CgKYUbK 5lS3uCT2NaM2PThybUOs3OUZAP5iRRzrvCRkvozJGezsp7e+AP+T8XYBpdOgaNzeh6YU Trqg== X-Received: by 10.70.54.198 with SMTP id l6mr25378265pdp.7.1414431156076; Mon, 27 Oct 2014 10:32:36 -0700 (PDT) Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id nu9sm11373392pbb.81.2014.10.27.10.32.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 10:32:35 -0700 (PDT) Message-ID: <544E81B2.5080107@gmail.com> Date: Mon, 27 Oct 2014 10:32:34 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Lester Caine , internals@lists.php.net References: <544DA1CD.9070109@php.net> <544E0AE1.9090406@lsces.co.uk> In-Reply-To: <544E0AE1.9090406@lsces.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: smalyshev@gmail.com (Stas Malyshev) Hi! > Is the resulting value intended always to return the same object > independent of what has been done to the object in the mean time? That's on you to decide. If you have immutable value object, then yes. If you have mutable value object (which usually isn't a good idea, but who knows) then no. If it's not a value object, then probably you don't want __hash on it at all. > A fixed 'address' for the physical data when used as an array key? If > that is the case, then __toKey seems more comfortable. To me a hash is I'm fine with __toKey, if that's what seems better to the majority.