reservedMemory = str_repeat(' ', 10 * 1024); } /** * Register the shutdown function */ protected function initShutdownFunction() { if (!$this->registeredShutdown) { $this->registerShutdownFunction([$this, 'shutdownFunction']) ?: false; $this->registeredShutdown = true; $this->reserveMemory(); } } /** * Called when the script has ends * @ignore */ public function shutdownFunction() { $this->reservedMemory = null; $err = $this->errorGetLast(); $unhandled = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR; if (empty($err) || !($err['type'] & $unhandled)) { return; } $error = new \ErrorException($err['message'], 0, $err['type'], $err['file'], $err['line']); if ($err['type'] & $this->getLoggedErrorTypes()) { $this->log($error); } $this->callOnFatalError($error); } }