Re: Line Number function?

From: Date: Sun, 02 Feb 2003 07:57:25 +0000
Subject: Re: Line Number function?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133975@lists.php.net to get a copy of this message
On Sun, 2 Feb 2003, Michael Sims wrote: > On Sat, 1 Feb 2003 19:59:00 -0800, you wrote: > > >PHP keeps track of what line# is being executed, so that when there's an > >error (say in pg_exec() ) it reports what line the error occured on. > [...] > >Is there a function where I can access this information? Something like > >"get_line();" or something? > > Do you mean like the predefined "constant" __LINE__? > > http://www.php.net/manual/en/language.constants.predefined.php Yep, that will do it and has been available in PHP for a very long time (along with __FILE__). PHP 4.3.0 introduces the following: __FUNCTION__ Function name __CLASS__ Class name debug_backtrace() Debugging information including the line number See: http://www.php.net/debug_backtrace Regards, Philip

« previous php.general (#133975) next »