Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3753 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18078 invoked from network); 6 Aug 2003 07:06:26 -0000 Received: from unknown (HELO flock1.newmail.ru) (212.48.140.157) by pb1.pair.com with SMTP; 6 Aug 2003 07:06:26 -0000 Received: (qmail 27646 invoked from network); 6 Aug 2003 07:06:07 -0000 Received: from unknown (HELO JUNGLE) (xi.newmail.ru@217.118.74.9) by smtpd.newmail.ru with SMTP; 6 Aug 2003 07:06:07 -0000 Date: Wed, 6 Aug 2003 14:07:36 +0600 X-Mailer: The Bat! (v1.62q) Personal Reply-To: Simeon Koptelov X-Priority: 3 (Normal) Message-ID: <1901746316.20030806140736@newmail.ru> To: internals@lists.php.net In-Reply-To: <20030805232317.67810.qmail@pb1.pair.com> References: <20030802224959.58552.qmail@pb1.pair.com> <20030802230007.65232.qmail@pb1.pair.com> <20030803033323.97051.qmail@pb1.pair.com> <13610291366.20030803105909@post.rwth-aachen.de> <20030803144736.43225.qmail@pb1.pair.com> <20030803195505.18983.qmail@pb1.pair.com> <1639357698.20030803225953@post.rwth-aachen.de> <20030803221049.98562.qmail@pb1.pair.com> <761875207.20030804001846@post.rwth-aachen.de> <20030803223448.11328.qmail@pb1.pair.com> <3F2F5229.5070004@akbkhome.com> <20030805232317.67810.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re[2]: [PHP-DEV] Re: hook cast_object handler in userspace From: xi@newmail.ru (Simeon Koptelov) Hello Cristiano, Here's why i think that interface is not good solution. We need the toString method like java's one to safely assume that _every_ object has the string representation. This means we can say $obj1->toString() and $obj2->toString() and don't care if $obj1 and $obj2 do support this method. In fact we _already_ have this functionality in ( string )$obj cast -- it's applicable to any object, doesn't it?. All we need is to formalize this cast in OOP manner. Interface is only the way to describe what class can do. If every class can provide it's string representation why should you implement some interface? It's only my $.20 though. -- Best regards, Simeon mailto:xi@newmail.ru