#13944 [Asn->Csd]: in a function, I want to know the file/line that CALLED the function

From: Date: Tue, 11 Feb 2003 18:20:38 +0000
Subject: #13944 [Asn->Csd]: in a function, I want to know the file/line that CALLED the function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32791@lists.php.net to get a copy of this message
ID: 13944 Updated by: derick@php.net Reported By: tysonlt_SPAM_IS_EVIL@webmedia.com.au -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: Linux RH7.1 PHP Version: 4.0.6 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Use debug_backtrace() for this in the latest CVS. Previous Comments: ------------------------------------------------------------------------ [2002-04-05 10:45:43] derick@php.net 80% done with this. Just need some more testing. regards, Derick ------------------------------------------------------------------------ [2002-04-05 10:03:58] csaba@ketszeri.hu On the Hungarian PHP list this is frequent question, and surely most of the developers -including me :)- would love it too! Naturally it is another self-administering task to the interpreter, so I would suggest to make it an optional 'developement-time' feature. Aabout nested includes: it would be good to return a complex data structure, when the programmer can step-back the calling process. Csabii ------------------------------------------------------------------------ [2001-11-05 21:41:57] tysonlt_SPAM_IS_EVIL@webmedia.com.au I would love to be able, from within a function, to find out the file/line no that called me. For example: /// some code /// $x = call_a_function(); function call_a_function() { echo "MY LOCATION: __FILE__ : __LINE__"; /*** This is what I would LOVE ***/ echo "CALLED FROM: __CALLING_FILE__ : __CALLING_LINE__"; } That would be fantastic! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=13944&edit=1

« previous php.bugs (#32791) next »