Re: __LINE__,__FILE__ + custom error handlers
| From: | Jason k Larson | Date: | Sun, 26 Jan 2003 08:48:37 +0000 |
| Subject: | Re: __LINE__,__FILE__ + custom error handlers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133162@lists.php.net to get a copy of this message | ||
from: http://www.php.net/manual/en/function.set-error-handler.php
string set_error_handler ( callback error_handler)
The user function needs to accept 2 parameters: the error code, and a
string describing the error. From PHP 4.0.2, an additional 3 optional
parameters are supplied: the filename in which the error occurred, the
line number in which the error occurred, and the context in which the
error occurred (an array that points to the active symbol table at the
point the error occurred).
example:
function myErrorHandler ($errno, $errstr, $errfile, $errline,
$errcontext) {...}
HTH,
Jason k Larson
electroteque wrote:
hi guys i am trying to create callback error functions handlers , i was wondering if there was a way to get the file and line caught in a error function say with a database abstraction query without having to explicitly put the line and number in the query function , at the moment if i put line and file inside the error handler it will only display where the error was caught inside the handler itself :|