Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77577 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47142 invoked from network); 24 Sep 2014 12:24:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2014 12:24:48 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:45986] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/A1-35478-D08B2245 for ; Wed, 24 Sep 2014 08:24:46 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id AFA4542423; Wed, 24 Sep 2014 14:24:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [10.0.2.15] (ppp-93-104-15-0.dynamic.mnet-online.de [93.104.15.0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 97E1842420; Wed, 24 Sep 2014 14:24:52 +0200 (CEST) To: Nicolai Scheer Cc: PHP Internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Wed, 24 Sep 2014 14:24:35 +0200 Message-ID: <1411561476.2303.4.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Tue, 2014-09-23 at 10:04 +0200, Nicolai Scheer wrote: > 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. Taking this sample code::: There the assumption would be that this leads to an array $a with two elements, where in fact there is only one if __toString() is being called. The only thing "making sense" would be using using the objects identity (i.e. via spl_object_hash()) everything else leads to issues. johannes