src/Reflection.php
public static function getPropertyValue($object, $property)
    {
        $ref = self::loadClassReflection($object);

        $refProperty = $ref->getProperty($property);

        if (!$refProperty->isPublic()) {
            $refProperty->setAccessible(true);
        }

        if ($refProperty->isStatic()) {
            $value = $refProperty->getValue();
        } else {
            $value = $refProperty->getValue($object);
        }

        return $value;
    }
public static function getPropertyValue($object, $property)
    {
        $ref = self::loadClassReflection($object);

        $refProperty = $ref->getProperty($property);

        if (!$refProperty->isPublic()) {
            $refProperty->setAccessible(true);
        }

        if ($refProperty->isStatic()) {
            $value = $refProperty->getValue();
        } else {
            $value = $refProperty->getValue($object);
        }

        return $value;
    }
Get property value

@param object|string $object
@param string        $property

@return mixed