php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #32902 Docs question: is __FILE__ === realpath (__FILE__) always true?
Submitted: 2005-04-30 19:38 UTC Modified: 2005-05-02 14:42 UTC
From: mpb dot mail at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
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: mpb dot mail at gmail dot com
New email:
PHP Version: OS:

 

 [2005-04-30 19:38 UTC] mpb dot mail at gmail dot com
Description:
------------
On this page:

http://www.php.net/manual/en/language.constants.predefined.php

There is a comment:

"mark at trilab dot ch 18-Apr-2003 10:44
Consider using
  realpath(__FILE__)
to get absolute paths."

However, it appears that on PHP 5.0.3 on FreeBSD realpath(__FILE__) is redundant.

It would be nice (for the sake of writing portable code) if the docs could say which versions of PHP remove symbolic links from __FILE__.  Perhaps they all do?  But then why would someone have added the comment?

Thanks!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-02 14:42 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Since PHP 4.0.2, __FILE__ always contains an absolute path whereas in older versions it contained relative path under some circumstances."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC