Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23953 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52801 invoked by uid 1010); 5 Jun 2006 03:59:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52786 invoked from network); 5 Jun 2006 03:59:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2006 03:59:50 -0000 X-PHP-List-Original-Sender: shiznatz@gmail.com X-Host-Fingerprint: 66.249.82.195 wx-out-0102.google.com Linux 2.4/2.6 Received: from ([66.249.82.195:55019] helo=wx-out-0102.google.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id EE/97-00946-53CA3844 for ; Sun, 04 Jun 2006 23:59:49 -0400 Received: by wx-out-0102.google.com with SMTP id s14so722952wxc for ; Sun, 04 Jun 2006 20:59:45 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=OsWWviFNvGsjnfVvJmWFCNE8+Lc9MsAWO/WaUjVs7dcwJPAvvU1hZkYfl+DelYedV5ra+/jUVbeGOYjtlpZ1Osnoga6+/bDQ50eWGFj6MgAD3zWRA6IhamJ9M2R2aSw1IztOUbecVfxP0taRA0GAK1vr92TmwJG7XX5dwW129Tw= Received: by 10.70.40.14 with SMTP id n14mr5598042wxn; Sun, 04 Jun 2006 20:59:45 -0700 (PDT) Received: by 10.70.99.10 with HTTP; Sun, 4 Jun 2006 20:59:45 -0700 (PDT) Message-ID: <1944df00606042059v2b6c5717m27afee0b52d52339@mail.gmail.com> Date: Mon, 5 Jun 2006 13:59:45 +1000 To: internals@lists.php.net In-Reply-To: <3928.209.254.223.2.1149477058.squirrel@www.l-i-e.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23141_2094648.1149479985574" References: <795156743.20060603134212@marcus-boerger.de> <3928.209.254.223.2.1149477058.squirrel@www.l-i-e.com> Subject: Re: [PHP-DEV] Missing __toString() part From: shiznatz@gmail.com ("Robert Amos") ------=_Part_23141_2094648.1149479985574 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline As far as I can see, and I'm sure someone will be kind enough to correct me if I'm wrong, but there is no current behaviour for it, it returns a warning. $a = new stdClass; $b[$a] = 0; Warning: Illegal offset type in t3.php on line 2 And results in an empty array (in this case) so it does nothing. -bok On 6/5/06, Richard Lynch wrote: > > On Sat, June 3, 2006 6:42 am, Marcus Boerger wrote: > > the attached patch closes one more __toString() part. It allows > > to use objects that define __toString as indexes to arrays. What do > > you guys think about this, should we add it or stay with the old > > behavior that didn't allow objects as indexes at all. > > I use objects rarely, and am not sure I care all that much, but... > > Seems to me that there is a REALLY good chance that there ARE scripts > "out there" that rely on current behaviour of: > > $a = new Foo(); > $arr[$a] = 42; > > Never mind that that's a really dumb thing to have -- Somebody is > relying on it doing whatever it does... > > Whether that is erroring out or just turning all objects into "" > doesn't matter. Somebody relies on it doing the same thing it always > did. > > Don't break that, please, in 5.2 -- Do whatever you want in 6.0 on that. > > This all seems like much ado about nothing to me. Anybody brainy > enough to NEED their objects as array indices can probably manage to > write a function to uniquely identify their/all objects. > > Sorry if my votes aren't fitting into the schema of voting... I kinda > got glassy-eyed with this whole thread, to tell the truth. > > -- > Like Music? > http://l-i-e.com/artists.htm > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Xnyo - http://xnyo.odynia.org/ ------=_Part_23141_2094648.1149479985574--