|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-09-07 12:15 UTC] dtyschenko at soft-ukraine dot com
  [2008-01-01 14:51 UTC] magnus@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 00:00:01 2025 UTC | 
Description: ------------ It appears to be impossible to determine the name of a file that calls a function stored in another file, e.g., a class library included at startup. The __FILE__ variable returns the name of the script which contains the function called (the class library in this example), but there doesn't seem to be any comparable variable that returns the name of the file where the function is invoked. In my particular case, I have a simple library function debug('debugtext',trigger_level) which compares trigger_level to a global value and prints 'debugtext' as appropriate. I'd like to be able to print out the name of the file that called this function as well so I can trace errors more efficiently. As it stands now, I don't see any way to do this other than some kludge that uses get_included_files().