Hello Cristiano, Wednesday, August 6, 2003, 3:19:34 PM, you wrote:
CD> Simeon Koptelov wrote: >> 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. >> CD> Maybe you're right. CD> I can move the code away from the "cast" function and create a toString CD> method on the "Object" class wich returns "Object id #n". CD> Let's see what the others think about it... Very bad idea, this is used as introspection and veryfication and ashouldn't be changed. -- Best regards, Marcus mailto:[EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php