You are here

public function ErrorHandler::throwAt in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/debug/ErrorHandler.php \Symfony\Component\Debug\ErrorHandler::throwAt()

Sets the PHP error levels that throw an exception when a PHP error occurs.

Parameters

int $levels A bit field of E_* constants for thrown errors:

bool $replace Replace or amend the previous value:

Return value

int The previous value

2 calls to ErrorHandler::throwAt()
ErrorHandler::setDisplayErrors in vendor/symfony/debug/ErrorHandler.php
Sets the display_errors flag value.
ErrorHandler::setLevel in vendor/symfony/debug/ErrorHandler.php
Sets the level at which the conversion to Exception is done.

File

vendor/symfony/debug/ErrorHandler.php, line 251

Class

ErrorHandler
A generic ErrorHandler for the PHP engine.

Namespace

Symfony\Component\Debug

Code

public function throwAt($levels, $replace = false) {
  $prev = $this->thrownErrors;
  $this->thrownErrors = (E_ALL | E_STRICT) & ($levels | E_RECOVERABLE_ERROR | E_USER_ERROR) & ~E_USER_DEPRECATED & ~E_DEPRECATED;
  if (!$replace) {
    $this->thrownErrors |= $prev;
  }
  $this
    ->reRegister($prev | $this->loggedErrors);

  // $this->displayErrors is @deprecated since version 2.6
  $this->displayErrors = $this->thrownErrors;
  return $prev;
}