|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45098 named constants require long opt
Submitted: 2008-05-26 19:38 UTC Modified: 2009-12-26 11:02 UTC
From: Assigned:
Status: Closed Package: Doc Build problem
PHP Version: Irrelevant OS: Mac
Private report: No CVE-ID:
 [2008-05-26 19:38 UTC]
Named constants seemingly cannot be used with short options, for example:


Whereas the following works:

  phd --version VERBOSE_NOVERSION

The difference is confusing, however, maybe there is a good reason.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-27 07:37 UTC]
(it is phd --verbose .. not --version :)

The real reason is that before PHP5.3 there was no such thing as "optional argument".
For the --verbose option it is natural to specify an option, but -v usually doesn't take arguments, but are passed multiple times for more verbosity.

We could fix it in 5.3 (optional argument), but then we would need some weird 5.2 BC code and it would be really inconsistent between PHP versions...


 [2009-12-26 11:01 UTC]
Automatic comment from SVN on behalf of bjori
Log: Fixed bug#45098 (named constants require long opt)
 [2009-12-26 11:02 UTC]
This bug has been fixed in SVN. Since the websites are not directly
updated from the SVN server, the fix might need some time to spread
across the globe to all mirror sites, including itself.

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

 [2009-12-26 11:02 UTC]
Note though: This is optional argument.
Optional arguments to shortops are -arg=value

phd -v=VERBOSE_INFO ...
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 15:01:32 2015 UTC