PHP has a var_dump() function which outputs the internal contents of an object, showing an object\'s type and content.
For example:
Your alternatives are to override the toString() method of your object to output its contents in a way that you like, or to use reflection to inspect the object (in a way similar to what debuggers do).
The advantage of using reflection is that you won't need to modify your individual objects to be "analysable", but there is added complexity and if you need nested object support you'll have to write that.
This code will list the fields and their values for an Object "o"
Field[] fields = o.getClass().getDeclaredFields();
for (int i=0; i