Doc #74827 [Opn->Nab]: Documentation incorrect regarding getopt options
| From: | requinix@php.net | Date: | Thu, 29 Jun 2017 03:15:40 +0000 |
| Subject: | Doc #74827 [Opn->Nab]: Documentation incorrect regarding getopt options | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14796@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74827&edit=1
ID: 74827
Updated by: requinix@php.net
Reported by: sciron64 at sindtech dot org
Summary: Documentation incorrect regarding getopt options
-Status: Open
+Status: Not a bug
Type: Documentation Problem
-Package: Documentation problem
+Package: PHP options/info functions
Operating System: GNU/Linux
PHP Version: 7.0.20
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
http://php.net/manual/en/function.getopt.php#refsect1-function.getopt-changelog
Previous Comments:
------------------------------------------------------------------------
[2017-06-29 02:40:46] sciron64 at sindtech dot org
Description:
------------
---
From manual page: http://www.php.net/function.getopt
---
http://php.net/manual/en/function.getopt.php
states 3 options can be passed to getopt:
"array getopt ( string $options [, array $longopts [, int &$optind ]] )"
Except $optind is unable to be processed by PHP v7.0.20.
To put another way, getopt only accepts _TWO_ parameters, not the documented three.
Test script:
---------------
<?php
$optInd = -1;
getopt("abcd",array("alfa", "beta", "charlie",
"delta"), $optInd);
Expected result:
----------------
No error message when using 3rd parameter.
Actual result:
--------------
PHP Warning: getopt() expects at most 2 parameters, 3 given in /var/www/scripts/getopt-test.php on
line 3
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74827&edit=1