Re: Retrieving the current file & line number
| From: | Toby Butzon | Date: | Fri, 01 Dec 2000 19:21:44 +0000 |
| Subject: | Re: Retrieving the current file & line number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28265@lists.php.net to get a copy of this message | ||
From PHP's manual - speaking of defining a custom error handling function
(which you can then trigger by calling the trigger_error() function):
"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 occured, the line
number in which the error occured, and the context in which the error
occured (an array that points to the active symbol table at the point the
error occurred)."
See the following for more info:
http://www.php.net/manual/features.error-handling.php
http://www.php.net/manual/function.set-error-handler.php
http://www.php.net/manual/function.trigger-error.php
Toby Butzon
[ criticism spurs improvement ]
----- Original Message -----
From: "Michael Bell" <mike@plexuspost.com>
To: "PHP Mailing List" <php-general@lists.php.net>
Sent: Friday, December 01, 2000 1:59 PM
Subject: [PHP] Retrieving the current file & line number
: I'm looking into generating error messages in my classes to store various
: information when an error happens. Is it possible to dump the current
: filename (this file may have been included from other documents) and the
: line number on which it happened. Hard coding the line numbers is not a
: solution as the code is constantly changing in length. Please keep in mind
: that they are caught errors (i.e.: PHP did not generate them.)
:
: Mike
:
: --------------------------------------------------
: Michael Bell
: Senior Systems Administrator
: MegaPlexus Corporation
: mike@megaplexus.com
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
: For additional commands, e-mail: php-general-help@lists.php.net
: To contact the list administrators, e-mail: php-list-admin@lists.php.net
:
: