Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23951 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2994 invoked by uid 1010); 5 Jun 2006 01:43:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2979 invoked from network); 5 Jun 2006 01:43:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2006 01:43:28 -0000 X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from ([66.11.173.122:28162] helo=interjinn.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 70/82-00946-F3C83844 for ; Sun, 04 Jun 2006 21:43:28 -0400 Received: from [192.168.1.3] (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id 4D6CA11FB77; Sun, 4 Jun 2006 21:43:22 -0400 (EDT) To: Gwynne Cc: Michael Gall , internals@lists.php.net In-Reply-To: <53E5B378-91CD-478A-B3F8-6C25DDD1A794@skytag.com> References: <795156743.20060603134212@marcus-boerger.de> <754ED3FF-418F-4E7F-A7A8-B1C0A1B59AFB@gravitonic.com> <53E5B378-91CD-478A-B3F8-6C25DDD1A794@skytag.com> Content-Type: text/plain Organization: InterJinn Message-ID: <1149471804.28722.2.camel@blobule> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-1mdk Date: Sun, 04 Jun 2006 21:43:24 -0400 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Missing __toString() part From: robert@interjinn.com (Robert Cummings) On Sun, 2006-06-04 at 20:49, Gwynne wrote: > On Jun 4, 2006, at 8:33 PM, Michael Gall wrote: > >> For example, for an eBay Item object, my __toString() returns the > >> Title, but that's not unique, so my __toHash() returns the numeric > >> ID, > >> which is. > > While I wouldn't be surprised if you completely ignore my opinion, > > however I > > think the __toHash implementation should happen in an interface, > > rather than > > happening automagically. That will make it just a little bit more > > predicatable. > > +1 on that from me. There is definitely a use for a __toHash() magic > function WITHOUT it being automagical. An automagical one would > probably lead to a lot of confusion and odd behaviors. Let people use > the feature if they need it and ignore it otherwise. But enforcing it's use via an interface means class users that don't want to use interfaces now need to use interfaces. Also the other magical functions aren't linked to interfaces, why change tradition? Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'