php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9592 print __FILE__ doesn't return full path when using include_once
Submitted: 2001-03-06 20:27 UTC Modified: 2001-03-12 10:56 UTC
From: vince at mha dot ca Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.4pl1 OS: Linux 2.4.2 (RedHat 6.x)
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vince at mha dot ca
New email:
PHP Version: OS:

 

 [2001-03-06 20:27 UTC] vince at mha dot ca
When doing "print(__FILE__);" it only echo's the file name not the full path when the file is included with include_once or require_once. I don't know if this is a bug or not, but my programming staff seems to think its a bug.

Example:

# php -v
4.0.4pl1
# grep -C php test.*
test.inc:<?php print (__FILE__."\n"); ?>
--
test.php:<?php include_once("test.inc"); ?>
# php -q test.php
/root/test.inc
# grep -C php test.*
test.inc:<?php print (__FILE__."\n"); ?>
--
test.php:<?php include_once("test.inc"); ?>
# php -q test.php
test.inc
# 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-12 10:56 UTC] andi@php.net
Should be fixed in latest CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC