Re: getting the line number
| From: | Adam Bregenzer | Date: | Mon, 07 Jun 2004 19:04:09 +0000 |
| Subject: | Re: getting the line number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187828@lists.php.net to get a copy of this message | ||
On Mon, 2004-06-07 at 14:52, Tim Traver wrote:
> I have a script that includes a separate file for functions.
>
> In a particular function, if a query gets an error, write out a log file
> that explains the error.
>
> The thing I am trying to determine is from what line the call was made from
> the parent script to the subroutine.
>
> I know that I can get the line number of the current script, but that
> doesn't tell me where the function was called from...
debug_backtrace[1] should get you everything you want and then some.
[1] http://www.php.net/debug_backtrace
--
Adam Bregenzer
adam@bregenzer.net
http://adam.bregenzer.net/