You are here

public function Stream::tell in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::tell()
  2. 8.0 vendor/guzzlehttp/psr7/src/Stream.php \GuzzleHttp\Psr7\Stream::tell()
  3. 8.0 vendor/symfony/psr-http-message-bridge/Tests/Fixtures/Stream.php \Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\Stream::tell()
Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::tell()

Returns the current position of the file read/write pointer

Return value

int Position of the file pointer

Throws

\RuntimeException on error.

Overrides StreamInterface::tell

File

vendor/zendframework/zend-diactoros/src/Stream.php, line 111

Class

Stream
Implementation of PSR HTTP streams

Namespace

Zend\Diactoros

Code

public function tell() {
  if (!$this->resource) {
    throw new RuntimeException('No resource available; cannot tell position');
  }
  $result = ftell($this->resource);
  if (!is_int($result)) {
    throw new RuntimeException('Error occurred during tell operation');
  }
  return $result;
}