HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

error_clear_last

Description

The error_clear_last of Error Handling for PHP clear the most recent error.

Syntax

error_clear_last ( void ) : void

Return

Clears the most recent errors, making it unable to be retrieved with error_get_last().

Examples

1 · void

<?

echo $error;

print_r(error_get_last());

error_clear_last();

var_export(error_get_last());
Array
(
    [type] => 8
    [message] => Undefined variable: error
    [file] => /home/user/public_html/index.php
    [line] => 3
)
NULL

2 · Return

<?

echo $error;

print_r(error_get_last());

$return = error_clear_last();

var_export($return);
Array
(
    [type] => 8
    [message] => Undefined variable: error
    [file] => /home/user/public_html/index.php
    [line] => 3
)
NULL