In PHP 5.2 the __toString() method is used to convert an object to a string. In PHP 5.1 the __toString() method is used to convert an object to a string but only when print or echo is called on the object. So, doing something like this won't work in 5.1:foo = bar('passing a string to a function '.$object.' won't convert the object to a string');