src/Stream.php
public function getSize()
    {
        if (is_resource($this->fp)) {
            $stats = fstat($this->fp);

            if (isset($stats['size'])) {
                return $stats['size'];
            }
        }

        return null;
    }
public function getSize()
    {
        if (is_resource($this->fp)) {
            $stats = fstat($this->fp);

            if (isset($stats['size'])) {
                return $stats['size'];
            }
        }

        return null;
    }
Get the size of the stream if known.

@return int|null Returns the size in bytes if known, or null if unknown.