src/Reflection/ReflectionObject.php
private function getRuntimeProperties(?int $filter = null) : array
    {
        if (! $this->reflectionClass->isInstance($this->object)) {
            throw new InvalidArgumentException('Cannot reflect runtime properties of a separate class');
        }

        // Ensure we have already cached existing properties so we can add to them
        $this->reflectionClass->getProperties();

        // Only known current way is to use internal ReflectionObject to get
        // the runtime-declared properties  :/
        $reflectionProperties = (new CoreReflectionObject($this->object))->getProperties();
        $runtimeProperties    = [];

        foreach ($reflectionProperties as $property) {
            if ($this->reflectionClass->hasProperty($property->getName())) {
                continue;
            }

            $reflectionProperty = $this->reflectionClass->getProperty($property->getName());

            $runtimeProperty = ReflectionProperty::createFromNode(
                $this->reflector,
                $this->createPropertyNodeFromReflection($property, $this->object),
                0,
                $reflectionProperty
                    ? $reflectionProperty->getDeclaringClass()->getDeclaringNamespaceAst()
                    : null,
                $this,
                $this,
                false
            );

            if ($filter !== null && ! ($filter & $runtimeProperty->getModifiers())) {
                continue;
            }

            $runtimeProperties[$runtimeProperty->getName()] = $runtimeProperty;
        }

        return $runtimeProperties;
    }
private function getRuntimeProperties(?int $filter = null) : array
    {
        if (! $this->reflectionClass->isInstance($this->object)) {
            throw new InvalidArgumentException('Cannot reflect runtime properties of a separate class');
        }

        // Ensure we have already cached existing properties so we can add to them
        $this->reflectionClass->getProperties();

        // Only known current way is to use internal ReflectionObject to get
        // the runtime-declared properties  :/
        $reflectionProperties = (new CoreReflectionObject($this->object))->getProperties();
        $runtimeProperties    = [];

        foreach ($reflectionProperties as $property) {
            if ($this->reflectionClass->hasProperty($property->getName())) {
                continue;
            }

            $reflectionProperty = $this->reflectionClass->getProperty($property->getName());

            $runtimeProperty = ReflectionProperty::createFromNode(
                $this->reflector,
                $this->createPropertyNodeFromReflection($property, $this->object),
                0,
                $reflectionProperty
                    ? $reflectionProperty->getDeclaringClass()->getDeclaringNamespaceAst()
                    : null,
                $this,
                $this,
                false
            );

            if ($filter !== null && ! ($filter & $runtimeProperty->getModifiers())) {
                continue;
            }

            $runtimeProperties[$runtimeProperty->getName()] = $runtimeProperty;
        }

        return $runtimeProperties;
    }
Reflect on runtime properties for the current instance

@see ReflectionClass::getProperties() for the usage of $filter

@return ReflectionProperty[]