php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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. 

Thanks

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-05 19:17 UTC] olli at ukgamer dot net
Sorry, i missed the constant "__FILE__".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC