You are here

public function Stream::detach in Zircon Profile 8.0

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

Separates any underlying resources from the stream.

After the stream has been detached, the stream is in an unusable state.

Return value

resource|null Underlying PHP stream, if any

Overrides StreamInterface::detach

1 call to Stream::detach()
Stream::close in vendor/zendframework/zend-diactoros/src/Stream.php
Closes the stream and any underlying resources.

File

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

Class

Stream
Implementation of PSR HTTP streams

Namespace

Zend\Diactoros

Code

public function detach() {
  $resource = $this->resource;
  $this->resource = null;
  return $resource;
}