original_string: public function withLocalScope()
      {
          if ($this->isClosed()) {
              throw new \RuntimeException("The stream is closed");
          }
          
          if (!$this->isGlobal()) {
              return $this;
          }
          
          $stream = clone $this;
          
          fwrite($stream->handle, (string)$this);
          
          return $stream;
      }
code: public function withLocalScope()
      {
          if ($this->isClosed()) {
              throw new \RuntimeException("The stream is closed");
          }
          
          if (!$this->isGlobal()) {
              return $this;
          }
          
          $stream = clone $this;
          
          fwrite($stream->handle, (string)$this);
          
          return $stream;
      }
code_tokens: public function withLocalScope ( ) { if ( $ this -> isClosed ( ) ) { throw new \ RuntimeException ( "The stream is closed" ) ; } if ( ! $ this -> isGlobal ( ) ) { return $ this ; } $ stream = clone $ this ; fwrite ( $ stream -> handle , ( string ) $ this ) ; return $ stream ; }
docstring: Get this stream in a local scope.
  If the stream is global, it will create a temp stream and copy the contents.
  
  @return OutputBufferStream
  @throws \RuntimeException
docstring_tokens: Get this stream in a local scope . If the stream is global it will create a temp stream and copy the contents .