I just found a nearly aproximation to python argparse library. The php library Getopt.PHP partialy emulates a parser with several features and same behaviour in argparse.
For example add_options()
~= addOptions()
method with positional or required arguments, automatic usage generation, retrieval values, error handling, etc.
At this moment, it still needs some work for more advanced features like conflict handler, choices or metavar, parse known values only, parameter exclusion, nargs, etc. But I can easily extended or use it as good implementation base start.
The Python example code in my question could be nearly translated (with missing features) to:
$getopt = new Getopt;
$getopt->addOptions(array(
array('o', 'output', Getopt::OPTIONAL_ARGUMENT, 'Set the output directory'),
array('q', 'quiet', Getopt::OPTIONAL_ARGUMENT, 'Don\'t print status messages to stdout'),
array('v', 'version', Getopt::OPTIONAL_ARGUMENT, 'Shows the program version'),
array('FILES', NULL, Getopt::REQUIRED_ARGUMENT),
));
$getopt->parse();