Re: Display line-numbers of funktion calls?
| From: | Pete James | Date: | Fri, 11 Apr 2003 21:32:49 +0000 |
| Subject: | Re: Display line-numbers of funktion calls? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143579@lists.php.net to get a copy of this message | ||
This is not possible before PHP 4.3. Using __FILE__ and __LINE__ will only give you what you're already getting, not what called it. PHP 4.3 provides the debug_backtrace() function, which will give you this information in a big stack array.
Have a look at http://www.php.net/debug_backtrace
HTH,
Pete.
Thomas Weber wrote, On 2003/Apr/11 2:29 PM:
Hi, does anyone know a way to get the file and line number of a function call within the called function? I use a self-written class for database-abstraction (for easily changing the databse-type) and when i get a sql-error, the scripts are only displaying the line number of the include-file with the class, wich complicates debugging quite much. Thanks, Thomas 'Neo' Weber --- thomas@youngarts.org neo@gothic-chat.de