Yaf_Application::clearLastError

(Yaf >=2.1.2)

Yaf_Application::clearLastErrorEfface les informations de la dernière erreur

Description

public function Yaf_Application::clearLastError(): Yaf_Application

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Exemples

Exemple #1 Exemple avec Yaf_Application::clearLastError()

<?php
function error_handler($errno, $errstr, $errfile, $errline) {
   Yaf_Application::app()->clearLastError();
   var_dump(Yaf_Application::app()->getLastErrorNo());
}
 
$config = array(                   
 "application" => array(
   "directory" => "/tmp/notexists",
     "dispatcher" => array(
       "throwException" => 0, //lance une erreur au lieu de lancer une exception lorsqu'une erreur survient
      ),
  ),
);
  
$app = new Yaf_Application($config);
$app->getDispatcher()->setErrorHandler("error_handler", E_RECOVERABLE_ERROR);
$app->run();
?>

Résultat de l'exemple ci-dessus est similaire à :

int(0)
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top