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" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > > > 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 > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php