code: public static function handleShutdown()
      {
          if (!empty($error = error_get_last())) {
              self::handleException(
                  new FatalException($error['message'], $error['type'], 0, $error['file'],
                      $error['line'])
              );
          }
      }
docs: Handle php shutdown and search for fatal errors.