public function getAnyPropertyValue($name, $object = null)
    {
        $property = $this->getProperty($name);
        $property->setAccessible(true);
        $value = $property->getValue($this->getObject($object));

        return $value;
    }
public function getAnyPropertyValue($name, $object = null)
    {
        $property = $this->getProperty($name);
        $property->setAccessible(true);
        $value = $property->getValue($this->getObject($object));

        return $value;
    }
public function getAnyPropertyValue ( $ name , $ object = null ) { $ property = $ this -> getProperty ( $ name ) ; $ property -> setAccessible ( true ) ; $ value = $ property -> getValue ( $ this -> getObject ( $ object ) ) ; return $ value ; }
Get property value in any case, if the property is not accessible, it will change the accessibility and restore
it before return.

@param string      $name   Property name
@param object|null $object If object was not given at construction time, it needs to be passed here

@return mixed Property value
Get property value in any case if the property is not accessible it will change the accessibility and restore it before return .