public static function _getLegibleObject($oObject) { if (method_exists($oObject, '__toString')) { return (string) $oObject; } return '(object) ' . get_class($oObject) . ' ' . count(get_object_vars($oObject)) . ' properties.'; }