|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: olli at ukgamer dot net
New email:
PHP Version: OS:


 [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: Mon May 23 08:05:45 2022 UTC