Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67823 invoked by uid 1007); 5 Aug 2003 23:23:17 -0000 Message-ID: <20030805232317.67810.qmail@pb1.pair.com> To: internals@lists.php.net 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> Date: Tue, 5 Aug 2003 20:23:15 -0300 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Posted-By: 200.196.104.198 Subject: Re: [PHP-DEV] Re: hook cast_object handler in userspace From: cunha17@uol.com.br ("Cristiano Duarte") Hi all, SK> Maybe it will be better to have this method in all classes and define SK> default behavior such as existing ( string )$object cast? I guess that using an interface is better. But if the guys here think different I would revert to the patch with no interfaces. AK> According to the current Coding Standard document.. it should be AK> toString() : even though php is not Case-sensitive:).. What about __construct, __destruct and __clone ? Shouldn't it be named __to_string() or __tostring() ? AK> Would be nice to see this work.. In fact, this does work. The method is called to_string(). Two questions: 1) I can't figure out a better name for the interface. Any ideas ? 2) Should all objects implent this method like __construct, __destruct and __clone or should it be left to the user to decide whether the object implements the printable interface or not.(IMHO a prefer the second) Cristiano Duarte. "Alan Knowles" escreveu na mensagem news:3F2F5229.5070004@akbkhome.com... > > > switch/case removed and patch attached. Is it ok? > > Should the method be named "to_string()", "tostring()" or "__tostring()" ? > According to the current Coding Standard document.. it should be > toString() : even though php is not Case-sensitive:).. > > Would be nice to see this work.. > > Regards > Alan > > > Do you commit it to CVS ? > > > > Cristiano Duarte > > > > > > > > > -- > Can you help out? > Need Consulting Services or Know of a Job? > http://www.akbkhome.com >