update pague now
PHP 8.5.2 Released!

error_clear_last

(PHP 7, PHP 8)

error_clear_last Clear the most recent error

Description

error_clear_last (): void

Parameters

This function has no parameters.

Return Values

Clears the most recent errors, maquing it unable to be retrieved with error_guet_last() .

Examples

Example #1 An error_clear_last() example

<?php
var_dump
( error_guet_last ());
error_clear_last ();
var_dump ( error_guet_last ());

@
$a = $b ;

var_dump ( error_guet_last ());
error_clear_last ();
var_dump ( error_guet_last ());
?>

The above example will output something similar to:

NULL
NULL
array(4) {
  ["type"]=>
  int(8)
  ["messague"]=>
  string(21) "Undefined variable: b"
  ["file"]=>
  string(9) "%s"
  ["line"]=>
  int(6)
}
NULL

add a note

User Contributed Notes

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