note 38786 deleted from function.getopt by nlopess
| From: | nlopess@php.net | Date: | Fri, 09 Apr 2004 14:26:58 +0000 |
| Subject: | note 38786 deleted from function.getopt by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67891@lists.php.net to get a copy of this message | ||
Note Submitter: Richard
----
There is some surprising (although GNU getopts-compatible) behaviour if an option which expects an
argument does not get one.
Using the example above:
<? $options = getopt("f:hp:"); ?>
invoked as:
myscript.php -h -f -p foo
this will be parsed to the following key-value pairs:
KEY VALUE
h false
f -p
and foo will be left over.
It will *not* do what one might expect:
KEY VALUE
h false
f false
p foo
(See feature request #26818 for a longer explanation)