PHP: set_exception_handler - Manual in Deutsh
PHP: set_exception_handler - Manual in French
PHP: set_exception_handler - Manual in Polish

You Are At PHP: set_exception_handler - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

set_exception_handler

(PHP 5)

set_exception_handler --  Sets a user-defined exception handler function

Description

string set_exception_handler ( callback exception_handler )

Sets the default exception handler if an exception is not caught within a try/catch block. Execution will stop after the exception_handler is called.

Parameters

exception_handler

Name of the function to be called when an uncaught exception occurs. This function must be defined before calling set_exception_handler(). This handler function needs to accept one parameter, which will be the exception object that was thrown.

Return Values

Returns the name of the previously defined exception handler, or NULL on error. If no previous handler was defined, NULL is also returned.

Examples

Example 1. set_exception_handler() example

<?php
function exception_handler($exception) {
  echo
"Uncaught exception: " , $exception->getMessage(), "\n";
}

set_exception_handler('exception_handler');

throw new Exception('Uncaught Exception');
echo
"Not Executed\n";
?>

See Also

restore_exception_handler(), restore_error_handler(), error_reporting(), information about the callback type, and PHP 5 Exceptions.

Widowiskowa i skuteczna reklama zewnętrzna dla twojego biznesu
sale sale szkoleniowe szkolenia
skarbykibica
meble łazienkowe
Pomoc drogowa Rzeszów merc

Another Useful functions:


zend-api.zend-hash-internal-pointer-reset-ex | function.xslt-set-error-handler | function.xslt-set-encoding | function.xml-set-external-entity-ref-handler | function.xml-set-end-namespace-decl-handler | function.xml-set-element-handler | function.tidy-set-encoding | function.snmp-set-enum-print | function.set-exception-handler | function.set-error-handler | function.pg-set-error-verbosity | function.newt-listbox-set-entry | function.newt-checkbox-tree-set-entry | function.newt-checkbox-tree-set-entry-value | function.mcal-event-set-end | function.iconv-set-encoding | function.ibase-set-event-handler | function.fdf-set-encoding |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.