Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23949 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90130 invoked by uid 1010); 5 Jun 2006 00:49:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 90115 invoked from network); 5 Jun 2006 00:49:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2006 00:49:19 -0000 X-PHP-List-Original-Sender: gwynne@skytag.com X-Host-Fingerprint: 208.97.132.53 mailbigip2.dreamhost.com Linux 2.4/2.6 Received: from ([208.97.132.53:58520] helo=spunkymail-a7.dreamhost.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 87/51-00946-F8F73844 for ; Sun, 04 Jun 2006 20:49:19 -0400 Received: from [192.168.1.104] (c-24-147-151-210.hsd1.ma.comcast.net [24.147.151.210]) by spunkymail-a7.dreamhost.com (Postfix) with ESMTP id 77BD25B6E1; Sun, 4 Jun 2006 17:49:15 -0700 (PDT) In-Reply-To: References: <795156743.20060603134212@marcus-boerger.de> <754ED3FF-418F-4E7F-A7A8-B1C0A1B59AFB@gravitonic.com> Mime-Version: 1.0 (Apple Message framework v749.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <53E5B378-91CD-478A-B3F8-6C25DDD1A794@skytag.com> Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Sun, 4 Jun 2006 20:49:12 -0400 To: "Michael Gall" X-Mailer: Apple Mail (2.749.3) Subject: Re: [PHP-DEV] Missing __toString() part From: gwynne@skytag.com (Gwynne) 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. However, if it was automagical, I'd agree with previous comments: Make it a string based on the hash table pointer. Gwynne SkyTag Software