Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79790 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33843 invoked from network); 17 Dec 2014 20:11:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2014 20:11:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@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: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.182 mail-ob0-f182.google.com Received: from [209.85.214.182] ([209.85.214.182:41209] helo=mail-ob0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/90-28186-263E1945 for ; Wed, 17 Dec 2014 15:11:14 -0500 Received: by mail-ob0-f182.google.com with SMTP id wo20so5615061obc.13 for ; Wed, 17 Dec 2014 12:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=m6s7Hi7q8owPnFqaIJXxuUCHAd8I2IfhQpf+rE7QPVY=; b=s4hlq8N9uw0JcCVFUnI73g2qq1VChOMGbbem1I7mVMaQZF1bkiYdzBrMfCnbxu6sVJ syyMy7GcBcyGUw1EDeAIZDr2wcyAzR1wADL0GmQ6OcqMIOwoh1IBZTwmvpeN6OVoRlZd MdkYB3Xois48HPj42dfPD1JW0gMCf9/OZ/DUeHXZ9JxnDm2LcEPlSC2G4GtsmRTgN0QH FZlluJ+MzrZ/eWV8rVFgdr+dPSaDEC6s/zLz5tFkW+S20873agB6i33Mt3JMavhP+GQj 6zQXIBezbA31TKoZp0o1yg3uJ16RMqOWbQD/+UyvmYoDa8v7Q76ugP6i0J2WoAUn4gK7 1r+w== MIME-Version: 1.0 X-Received: by 10.60.84.196 with SMTP id b4mr10216887oez.49.1418847070355; Wed, 17 Dec 2014 12:11:10 -0800 (PST) Sender: morrison.levi@gmail.com Received: by 10.76.89.237 with HTTP; Wed, 17 Dec 2014 12:11:10 -0800 (PST) In-Reply-To: <5491CE95.7060909@gmail.com> References: <548FEE87.7020602@gmail.com> <5491B77A.4020004@gmail.com> <5491CE95.7060909@gmail.com> Date: Wed, 17 Dec 2014 13:11:10 -0700 X-Google-Sender-Auth: 0MIeSFyIKE9jIhR8FHNd1h3L5pk Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: levim@php.net (Levi Morrison) >> and likely prevents us >> from adding support for objects as keys in the future should we want > > No it does not. It was already explained several times. If it is ever > introduced, it can be used for objects that do not explicitly request > functionality in this RFC by enabling __hash() with no BC issues, since > this RFC only affects classes that explicitly ask for this specific > functionality. So if you, according to the above, would never use > __hash, absolutely nothing would prevent you from using objects as keys > if it ever happens (which it probably won't in the next 2-3 years). Just because you say it doesn't affect it doesn't mean it doesn't. I think it would be quite silly to support storing hashes and/or storing objects and to me that blocks the latter since you are proposing the former. > Nothing in this RFC prevents you from having such structures. In fact, > this RFC would enable more convenient handling of such structures, > providing common method for requesting the programmable hash value of > the object - a feature which most languages have, but PHP does not. Programmable hashes of objects should be external to the object anyway because eventually someone wants to store the same object in a different way in two different structures.