ulrichsg/getopt-php
Command line arguments parser for PHP 7.1 and above
v4.0.4
5.4M downloads/mo
#1207 most downloaded on Packagist
getopt-php/getopt-php
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 months to 2.2 years
Most releases are documented
notes for 20 of 31 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
41 releases · first in 2012
0 releases in the last 12 months
see the full history below
Release timeline
40 releases · Jan 2012 to Feb 2025Releases
latest 41-
v4.0.411 Feb 2025Release notes
Open source →Changelog:
- fix nullable parameters (many thanks to @AdamSGit)
- fix github actions and add tests on php 8.4
-
v4.0.313 Dec 2022 -
v4.0.211 Mar 2022Release notes
Open source →Changelog:
- add php 8.0 to compatibility list in composer.json
- use the latest phpunit versions available for the php version (#175)
-
v4.0.104 Jan 2022Release notes
Open source →Changelog:
- fix ArrayAccess signature compatibility in php 8.1 (mixed return value; see #171)
-
v4.0.002 May 2021Release notes
Open source →Changelog:
- drop support for php 5.x and add support for php 8
- run tests on php 7.x and php 8 on gitlab-ci
- add type declarations for parameters
- add link to github versions in old changelog
- fix return type declarations
-
v4.0.0-alpha.118 Feb 2021 pre-releaseNothing published for this version
-
v3.4.014 Jul 2020Release notes
Open source →Version 3.4
This might be the last version 3 version as we might get rid of the php 5.x compatibility.
Changelog:
-
v3.3.006 Nov 2019Nothing published for this version
-
v3.3.0-rc.108 Sep 2019 pre-releaseNothing published for this version
-
3.2.222 Jan 2019Release notes
Open source →Changelog
- accept option arguments starting with a hypen when argument is required
-
3.2.117 Aug 2018Nothing published for this version
-
3.2.031 May 2018Nothing published for this version
-
3.2.0-alpha.1no date pre-releaseNothing published for this version
-
3.1.329 May 2018Nothing published for this version
-
3.1.215 May 2018Nothing published for this version
-
3.1.101 May 2018Nothing published for this version
-
3.1.025 Nov 2017Nothing published for this version
-
3.1.0-alpha.108 Nov 2017 pre-releaseNothing published for this version
-
3.0.302 Nov 2017Nothing published for this version
-
3.0.224 Aug 2017Nothing published for this version
-
3.0.123 Aug 2017Nothing published for this version
-
3.0.018 Aug 2017Release notes
Open source →Features:
- php 5.3 support dropped (solves #72)
- moved to neutral namespace
GetOpt - classname changed to
GetOpt - second parameter for constructor got array of settings (use
GetOpt::SETTING_*constants) - argument constants changed to string
:*Arg - parse options after operands (gnu compatibility; solves #39)
- added
GetOpt::MULTIPLE_ARGUMENTfor parameter aggregation (solves #57) - implemented
Commandfor kinda routing in console applications (solves #41) - implemented
Operandfor named operands and validation (solves #27) - added strict modes for strict operand and parameter matches (default is true for options) (solves #14)
- added
HelpInterfacefor custom help implementations - refactored
GetOpt::getHelpText()for better support of other features and customization - default help class uses templates
Bugfixes:
GetOpt::count()returns the wrong value (solves #70)
-
3.0.0-beta.107 Aug 2017 pre-releaseNothing published for this version
-
3.0.0-alpha.805 Aug 2017 pre-releaseNothing published for this version
-
3.0.0-alpha.702 Aug 2017 pre-releaseNothing published for this version
-
3.0.0-alpha.630 Jul 2017 pre-releaseNothing published for this version
-
3.0.0-alpha.428 Jul 2017 pre-releaseNothing published for this version
-
3.0.0-alpha.326 Jul 2017 pre-releaseNothing published for this version
-
2.4.302 Jul 2017 -
2.4.201 Jul 2017Release notes
Open source →Features:
- don't show options when there are no options configured
- allow arguments in quotes (allows single quote in double quote and vice versa)
- get script name from argv[0] when parsing arguments from array or string
- add method to set script name manually
- support for php 7.1
-
2.3.028 Mar 2015Release notes
Open source →Features:
- Optional argument descriptions (courtesy of @sabl0r)
Bugfixes:
- Passing a single hyphen as an option value works now (courtesy of @tistre)
-
2.2.013 Sep 2014Release notes
Open source →Features:
- Added method to customize the help message (courtesy of @mfn)
- Option now has a static create method for call chaining in PHP 5.3 (courtesy of @kamermans)
-
2.1.028 Feb 2014 -
2.0.030 Jan 2014 -
1.4.113 Dec 2013Release notes
Open source →Bugfixes:
- Long options are required to be longer than 1 character
- Passing duplicate option names to the constructor is forbidden by default
-
1.4.013 Dec 2013Release notes
Open source →Features:
- Options can be numeric (courtesy of @patinthehat)
- Additional convenience methods for working with operands (ditto)
-
1.3.007 Dec 2013Release notes
Open source →Features:
- Default values for options
- ArrayAccess, Countable and Traversable support
- Can set program name to enhance help message (courtesy of @misterion)
-
1.2.014 Nov 2013 -
1.1.019 Jun 2013Release notes
Open source →Features:
- Added help text printing functionality
Bugfixes:
- Fixed passing a mandatory argument to the last in a sequence of collapsed short options
-
1.0.113 Feb 2013 -
1.0.004 Jan 2012Nothing published for this version