|  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
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.
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 21 19:01:29 2024 UTC