F.11. Error Handling

FunctionReturnsDescription
error_log(string message [, int message_type [, string destination [, string extra_headers]]])
boolSends an error message somewhere.
debug_print_backtrace(void) */
voidPrints a backtrace.
debug_backtrace(void)
arrayReturns backtrace as array.
restore_error_handler(void)
voidRestores the previously defined error handler function.
set_exception_handler(string exception_handler)
stringSets a user-defined exception handler function. Returns the previously defined exception handler, or false on error.
restore_exception_handler(void)
voidRestores the previously defined exception handler function.
trigger_error(string messsage [, int error_type])
voidGenerates a user-level error/warning/notice message.
set_error_handler(string error_handler)
stringSets a user-defined error handler function. Returns the previously defined error handler, or false on error.
leak(int num_bytes=3)
voidCauses an intentional memory leak, for testing/debugging purposes.

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.