src/types/Error.php
public function toString(/*boolean*/ $includeFile = false) {
    $format = true === $includeFile
      ? '%s #%d (%s): %s in %s(%d)'
      : '%s #%d (%s): %s';
    return sprintf(
      $format,
      $this->getType(),
      $this->getCode(),
      $this->getMagic(),
      $this->getMessage(),
      $this->getFile(),
      $this->getLine()
    );
  }
public function toString(/*boolean*/ $includeFile = false) {
    $format = true === $includeFile
      ? '%s #%d (%s): %s in %s(%d)'
      : '%s #%d (%s): %s';
    return sprintf(
      $format,
      $this->getType(),
      $this->getCode(),
      $this->getMagic(),
      $this->getMessage(),
      $this->getFile(),
      $this->getLine()
    );
  }
Returns the error as a string with all necessary details.

@param boolean $includeFile whether to include source file name and line
@return string