#11651 [Opn->WFx]: Need something like a __LINE__ constant to show the line in *main* file.

From: Date: Tue, 22 Apr 2003 04:59:56 +0000
Subject: #11651 [Opn->WFx]: Need something like a __LINE__ constant to show the line in *main* file.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38033@lists.php.net to get a copy of this message
ID: 11651 Updated by: pollita@php.net Reported By: dron007 at yahoo dot com -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: Linux RedHat 5.2 PHP Version: 4.0.5 New Comment: This functionality already exists, after a fashion, by using the debug_backtrace() function. Essentially, you want to retrieve the backtrace data using debug_backtrace, then look at the second to last element's 'line' member. Refer to the manual page for debug_backtrace() for more information. Previous Comments: ------------------------------------------------------------------------ [2001-06-25 04:34:27] dron007 at yahoo dot com When some error happens in function within included file it is sometimes very hard to find from which line in the main script (containing include function) this function was called. It would be much better if there were a way to get the number of the line within the main script file which is being parsed. file1: include ("file2"); some_function(); file2: function some_function() { ... } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=11651&edit=1

« previous php.bugs (#38033) next »