array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'yaf-application.clearlasterror.php', 1 => 'Yaf_Application::clearLastError', 2 => 'Clear the last error info', ), 'up' => array ( 0 => 'class.yaf-application.php', 1 => 'Yaf_Application', ), 'prev' => array ( 0 => 'yaf-application.bootstrap.php', 1 => 'Yaf_Application::bootstrap', ), 'next' => array ( 0 => 'yaf-application.construct.php', 1 => 'Yaf_Application::__construct', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/yaf/yaf_application/clearlasterror.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(Yaf >=2.1.2)
Yaf_Application::clearLastError — Clear the last error info
Diese Funktion besitzt keine Parameter.
Beispiel #1 Yaf_Application::clearLastError()example
<?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, //trigger error instead of throw exception when error occure
),
),
);
$app = new Yaf_Application($config);
$app->getDispatcher()->setErrorHandler("error_handler", E_RECOVERABLE_ERROR);
$app->run();
?>
Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
int(0)