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.
Maybe you're right.
I can move the code away from the "cast" function and create a toString method on the "Object" class wich returns "Object id #n".
Let's see what the others think about it...
Cristiano Duarte
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php