PHP has a var_dump() function which outputs the internal contents of an object, showing an object\'s type and content.
For example:
The apache commons lang package provides such a class which can be used to build up a default toString() method using reflection to get the values of fields. Just have a look at this.