array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.error-clear-last.php', 1 => 'error_clear_last', 2 => 'Clear the most recent error', ), 'up' => array ( 0 => 'ref.errorfunc.php', 1 => 'Функції Обробки Помилок', ), 'prev' => array ( 0 => 'function.debug-print-backtrace.php', 1 => 'debug_print_backtrace', ), 'next' => array ( 0 => 'function.error-get-last.php', 1 => 'error_get_last', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/errorfunc/functions/error-clear-last.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 7, PHP 8)
error_clear_last — Clear the most recent error
У цієї функції немає параметрів.
Clears the most recent errors, making it unable to be retrieved with error_get_last().
Приклад #1 An error_clear_last() example
<?php
var_dump(error_get_last());
error_clear_last();
var_dump(error_get_last());
@$a = $b;
var_dump(error_get_last());
error_clear_last();
var_dump(error_get_last());
?>Поданий вище приклад виведе щось схоже на:
NULL
NULL
array(4) {
["type"]=>
int(8)
["message"]=>
string(21) "Undefined variable: b"
["file"]=>
string(9) "%s"
["line"]=>
int(6)
}
NULL