Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77514 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68795 invoked from network); 23 Sep 2014 08:51:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2014 08:51:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.169 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 74.125.82.169 mail-we0-f169.google.com Received: from [74.125.82.169] ([74.125.82.169:59734] helo=mail-we0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/F9-09206-68431245 for ; Tue, 23 Sep 2014 04:51:19 -0400 Received: by mail-we0-f169.google.com with SMTP id k48so4193435wev.14 for ; Tue, 23 Sep 2014 01:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=WMVoJyEjC6V6bkFldBXYRPA/HBoS0aTDXSZxXffTRBY=; b=eSwW1y/Q+zwvD8FGZ+/fFpnbOT6M03hnMii7+qi6ndp2wT3iD7e0y5BEcvkoNLZnEZ 0Wq4qOPHMToI8tWzU0Xj9BoBslO0NSuzzpoG9K0IveyFCrgVBIgvvEIl7x7u3KY/eKk5 uBsvF3PvE7hD5wbQgyGwSGfgfJ6dAKdJbPxoDTFNHJlOPF4EnLmmcPhrorIONMSgRxjC GiHsyayDyUGme2rpI1seKlfrMToKxQTli2wkBvSh1p9nw5Qw42agyHhskiQA1j5YAAaP 7a12+9CSldO9iUqJNL8MwEKB1yrkJmtQHmcucU3WYddt/BMiH1guyFT6WEws+XaYDN1v 68XA== X-Received: by 10.180.91.16 with SMTP id ca16mr20787046wib.78.1411462275719; Tue, 23 Sep 2014 01:51:15 -0700 (PDT) Received: from [192.168.4.120] (178-18-170-101.customer.bnet.at. [178.18.170.101]) by mx.google.com with ESMTPSA id cb10sm1461632wib.19.2014.09.23.01.51.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Sep 2014 01:51:14 -0700 (PDT) Sender: Michael Wallner Message-ID: <54213481.8080700@php.net> Date: Tue, 23 Sep 2014 10:51:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Nicolai Scheer , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: mike@php.net (Michael Wallner) On 2014-09-23 10:04, Nicolai Scheer wrote: > Hi all, > > until 5 minutes ago I thought it would be perfectly legal to use an object > as an array key, given that its __toString() method is in place. > > Seems as if I was wrong. > I know that array keys are not what is considered "string context" > internally, at least not directly. > > Would it harm in any way to add that feature? Yes, it was removed intentionally (quite a long time ago), like using resources as array keys, to avoid hard-to-trace bugs for the user. At least that's the reasoning I can remember. -- Regards, Mike