getProperties() as $property) { $property->setAccessible(true); $properties[$property->getName()] = $this->formatValue($property->getValue($command)); } return $properties; } /** * Return the given (property) value as a descriptive string * * @param mixed $value Can be literally anything * @return string */ protected function formatValue($value) { switch (gettype($value)) { case 'object': return 'object(' . get_class($value) . ')'; case 'array': return '*array*'; case 'resource': return 'resource(' . get_resource_type($value) . ')'; default: return $value; } } }