- print_r: documentation ( source)
- get_object_vars: documentation ( source)
<?php
$obj = (object)array('a', 'b', 'c');
$refl = new \ReflectionObject($obj);
$props = $refl->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED);
foreach($props as $prop)
print $prop->name;
print_r(get_object_vars($obj));
print_r($obj);