/** * @param object $object * @param \ReflectionProperty $property * @param int $level * @return string */ private function dumpProperty($object, \ReflectionProperty $property, $level) { if ($property->isStatic()) { return ''; } if (!$object instanceof \stdClass && strpos($property->getDocComment(), '@invisible') !== false) { //Memory loop while reading doc comment for stdClass variables? //Report a PHP bug about treating comment INSIDE property declaration as doc comment. return ''; } //Property access level $access = $this->getAccess($property); //To read private and protected properties $property->setAccessible(true); if ($object instanceof \stdClass) { $access = 'dynamic'; } //Property name includes access level $name = $property->getName() . $this->style->style(":" . $access, "access", $access); return $this->dumpValue($property->getValue($object), $name, $level + 1); }