Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79735 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66538 invoked from network); 16 Dec 2014 18:14:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2014 18:14:32 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.53 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.218.53 mail-oi0-f53.google.com Received: from [209.85.218.53] ([209.85.218.53:44451] helo=mail-oi0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/89-12185-78670945 for ; Tue, 16 Dec 2014 13:14:32 -0500 Received: by mail-oi0-f53.google.com with SMTP id g201so1141856oib.12 for ; Tue, 16 Dec 2014 10:14:29 -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=qAAy3iCey53stJlx9HfV9VEn61C63LlkiVpMGvjZK6g=; b=K+ANpTvbO/AIlZjx0ucE+cTfI66HN7eNrdSthq83/i1mv30nrk5dnaQA3PRECTeNZH zA74QWdLXqLCv0hA3bJ6g4t6n4iM4FR1eoEQQEmiOi71GMR7xKHZ1vJMzEMxi2g1FmP0 1l4Ylv5nJP/T7Ku33/hokR/YhGAIjU283VZzLcuMYJXQyewShL3qdbLf8C+RJHm8OH/g 03huyViDtlgoBcxpnKI6a56i1rMsE+rHks51X1Rbkyv56/tNQdkPAXGdGSXwZuXPc7cO a6IXG0gmK3sEjdkibFS1BQhGEJrDp3eay8PLRUylULTA89PPGYnHHgOK6cXUQ2OaDtxg mv/w== X-Received: by 10.202.87.212 with SMTP id l203mr22099128oib.36.1418753669328; Tue, 16 Dec 2014 10:14:29 -0800 (PST) Received: from [192.168.2.145] (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id nx8sm614398obb.29.2014.12.16.10.14.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 10:14:28 -0800 (PST) Message-ID: <54907683.2070509@gmail.com> Date: Tue, 16 Dec 2014 10:14:27 -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: Andrea Faulds , Markus Fischer CC: internals@lists.php.net References: <548FEE87.7020602@gmail.com> <549009EE.7040808@fischer.name> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I was previously in favour of this, but it’d prevent actual indexing No, of course it won't - if we ever introduce indexing objects (which probably will require rewrite of the HashTable, any takers?) it would be very easy to index any object that does not implement __hash without any BC problem, and convert all those implementing __hash to "return $this" if desired. > by objects in future, and I can’t think of any use cases which > aren’t better solved by explicitly converting to a string/integer. There's no implicit conversion, and explicit one is a) inacessible in userspace for anything but string and b) annoying for the same reasons for which __toString exists. -- Stas Malyshev smalyshev@gmail.com