|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
22 + 6 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 10 10:01:27 2023 UTC