- var_dump: documentation ( source)
<?php
$an_array = array();
$reflection = new ReflectionClass($an_object);
$properties = $reflection->getProperties();
foreach ($properties as $property)
{
$property->setAccessible(true);
$an_array[$property->getName()] = $property->getValue($an_object);
if (!$property->isPublic())
$property->setAccessible(false);
}
var_dump($an_array);
?>