Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23960 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88949 invoked by uid 1010); 5 Jun 2006 09:54:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88934 invoked from network); 5 Jun 2006 09:54:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2006 09:54:52 -0000 X-PHP-List-Original-Sender: M.Ford@leedsmet.ac.uk X-Host-Fingerprint: 160.9.128.18 mrelay-c.lmu.ac.uk Received: from ([160.9.128.18:35655] helo=mrelay-c.lmu.ac.uk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A2/54-00946-A6FF3844 for ; Mon, 05 Jun 2006 05:54:50 -0400 Received: from localhost.lmu.ac.uk ([127.0.0.1] helo=localhost) by mrelay-c.lmu.ac.uk with esmtp (Exim 4.43) id 1FnBlj-0000r4-9B for internals@lists.php.net; Mon, 05 Jun 2006 10:53:07 +0100 Received: from mrelay-c.lmu.ac.uk ([127.0.0.1]) by localhost (mrelay-c [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01856-05 for ; Mon, 5 Jun 2006 10:53:04 +0100 (BST) Received: from leedsmet-exch1.leedsmet.ac.uk ([160.9.35.117]) by mrelay-c.lmu.ac.uk with esmtp (Exim 4.43) id 1FnBlQ-0000qH-6w for internals@lists.php.net; Mon, 05 Jun 2006 10:52:48 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Mon, 5 Jun 2006 10:55:16 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Missing __toString() part Thread-Index: AcaH8+slDn4GFISbSk+Aep8q64Zd2QAkXzUQ To: X-Virus-Scanned: by McAfee at Leeds Metropolitan University Subject: RE: [PHP-DEV] Missing __toString() part From: M.Ford@leedsmet.ac.uk ("Ford, Mike") On 04 June 2006 17:18, Rasmus Lerdorf wrote: > I think if we implement a way to get a hash from an object, > or at least > a unique identifier that can be used as a hash, then it should be > implicit just like other things are implicitly converted when the > context is clear. Of course, you should also be able to force it > explicitly. And I don't think there is any point in doing > this unless > we also implicitly go the other way. From unique identifier > to object. > As in: >=20 > class foo { function bar($arg) { echo $arg; } } > $obj1 =3D new foo; > $obj2 =3D new foo; >=20 > $a =3D array($obj1=3D>1,$obj2=3D>2); > foreach($a as $k=3D>$v) { > $k->bar($v); > } >=20 > Unless this works, I am not sure there is any point to all > this. To me > the end goal is to make it possible to use types other than strings > and numbers as array indices which to me also means we should > look at doing > the same for arrays. Thank you Rasmus, that was my exact concern too. Unless this works as you'= ve specified, I'd be -1 for anything but explicit $a[(string)$b]. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211=20 To view the terms under which this email is distributed, please go to http:= //disclaimer.leedsmet.ac.uk/email.htm