|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16459 way to get *actual* filename code is in (include() breaks available methods)
Submitted: 2002-04-05 19:07 UTC Modified: 2002-04-05 19:17 UTC
From: olli at ukgamer dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.1.2 OS: Win*/Slackware
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
46 + 15 = ?
Subscribe to this entry?

 [2002-04-05 19:07 UTC] olli at ukgamer dot net
There doesn't appear to be a way to get the filename of code that is currently executing. 

Eg. echo $SCRIPT_FILENAME; or echo $PHP_SELF; 
works fine in most situations, but as soon as the file containing this code is included in another, they start to return the filename of the includING file. (not the includED one).

I understand this generally goes against the purpose of include() but this functionality would be very useful. 



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-05 19:17 UTC] olli at ukgamer dot net
Sorry, i missed the constant "__FILE__".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 05:05:44 2022 UTC