code: public function stream_open($path, $mode, $options, &$openedPath)
      {
          if ($this->handle) {
              return false;
          }
          $useIncludePath = (bool) $options & STREAM_USE_PATH;
          $context = $this->context;
          if ($context === null) {
              $context = \stream_context_get_default();
          }
          self::restorePrev();
          if (\strpos($mode, 'r') !== false && !\file_exists($path)) {
              return false;
          } elseif (\strpos($mode, 'x') !== false && \file_exists($path)) {
              return false;
          }
          $handle = \fopen($path, $mode, $useIncludePath, $context);
          self::register();
          if ($handle === false) {
              return false;
          }
          /*
              Determine opened path
          */
          $meta = \stream_get_meta_data($handle);
          if (!isset($meta['uri'])) {
              throw new \UnexpectedValueException('Uri not in meta data');
          }
          $this->filepath = $openedPath = $meta['uri'];
          $this->handle = $handle;
          return true;
      }
docs: Opens file or URL
  
  @param string   $path       Specifies the file/URL that was passed to the original function.
  @param string   $mode       The mode used to open the file, as detailed for fopen().
  @param integers $options    Holds additional flags set by the streams API. I
  @param string   $openedPath the full path of the file/resource that was actually opened
  
  @return boolean
  
  @see    http://php.net/manual/en/streamwrapper.stream-open.php
  @throws \UnexpectedValueException