Stream::seek( $offset,  $whence = SEEK_SET )

Source

public function seek($offset, $whence = \SEEK_SET): void
{
    if (!isset($this->stream)) {
        throw new \RuntimeException('Stream is detached');
    }
    if (!$this->seekable) {
        throw new \RuntimeException('Stream is not seekable');
    }
    if (-1 === \fseek($this->stream, $offset, $whence)) {
        throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, \true));
    }
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.