Why don't simply write get_class($object) ?