Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78387 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34390 invoked from network); 27 Oct 2014 10:18:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2014 10:18:05 -0000 Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:64532] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/0D-56216-DDB1E445 for ; Mon, 27 Oct 2014 05:18:05 -0500 Received: by mail-wg0-f52.google.com with SMTP id y10so2718505wgg.35 for ; Mon, 27 Oct 2014 03:18:02 -0700 (PDT) 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=aBPkZIsMtjtQAU4w9B/PbD10IXRO3cNWqNtv4C8B0hM=; b=SH6X0me78OEtdQIOL+hDDk18GWZInWxEvVZQmnTF0sstnPdRhDRPeBAnzS12ku1ytC 251ROGNBJHdxmipABv0nlqzktgXjRLPSLIJOap0CLMcCvSWE0Y3E5IHpAuaDLOtFRZTW vfzzSMSPUUAMCIMpTGWCSPiSUTA0SN2LnmzqlO4aTcPvQ8N5D9zJAjzT6V/dwVp8ySDC udlanWjkmqH8a0U45X+QfEjcUIbbyM10bM+Y2TSG+Nmx1vM99FwVQRzrjHd1PYIs/yAC Xa3O1LpPhTtidPuzeO0Ad7rPLmEUQk7/kJtcX24pxEU3anmyLa6feY3O/j9Tu2Si9NzU MkmA== MIME-Version: 1.0 X-Received: by 10.180.211.2 with SMTP id my2mr8178426wic.13.1414405082577; Mon, 27 Oct 2014 03:18:02 -0700 (PDT) Received: by 10.194.42.137 with HTTP; Mon, 27 Oct 2014 03:18:02 -0700 (PDT) In-Reply-To: <544DA1CD.9070109@php.net> References: <544DA1CD.9070109@php.net> Date: Mon, 27 Oct 2014 14:18:02 +0400 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c37c18840473050664d81c Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: lisachenko.it@gmail.com (Alexander Lisachenko) --001a11c37c18840473050664d81c Content-Type: text/plain; charset=UTF-8 Hello, internals! > 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. I like this idea with custom hash implementation because spl_object_hash() is not reliable when objects are quickly created/destroyed, so hashes can be the same for several different objects. However, will it be better to introduce an interface for that? For example, Hashable can be a good name (like Traversable one). Default implementation then can be a simple trait that will be added later to the concrete class. --001a11c37c18840473050664d81c--