src/Reflection/ReflectionObject.php
public static function export($instance = null) : string
    {
        if ($instance === null) {
            throw new InvalidArgumentException('Class instance must be provided');
        }

        return self::createFromInstance($instance)->__toString();
    }
public static function export($instance = null) : string
    {
        if ($instance === null) {
            throw new InvalidArgumentException('Class instance must be provided');
        }

        return self::createFromInstance($instance)->__toString();
    }
Create a reflection and return the string representation of a class instance

@param object $instance

@throws IdentifierNotFound
@throws ReflectionException
@throws InvalidArgumentException