|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44717 Magic constants: Don't work
Submitted: 2008-04-14 14:44 UTC Modified: 2008-04-14 14:59 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: pazpog at yahoo dot co dot uk Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.2.5 OS: XP SP2
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: pazpog at yahoo dot co dot uk
New email:
PHP Version: OS:


 [2008-04-14 14:44 UTC] pazpog at yahoo dot co dot uk
Magic constants do not work in CLI. It simply returns the name of the constant - For example, if the constant is called __DIR__, it would just return __DIR__ instead of the directory the script is in.

Reproduce code:

Expected result:
I expected it to echo the directory the script is in. Eg; E:\phpHuman.

Actual result:
It echos __DIR__ (the name of the constant).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-14 14:48 UTC] pazpog at yahoo dot co dot uk
Changed the Category (I chose the wrong one).
 [2008-04-14 14:59 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This is only available in PHP 5.3+
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 23:01:28 2024 UTC