Req #50244 [Com]: getopt() does not reset
| From: | alexc223 at googlemail dot com | Date: | Mon, 18 Oct 2010 18:34:41 +0000 |
| Subject: | Req #50244 [Com]: getopt() does not reset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-155308@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50244&edit=1
ID: 50244
Comment by: alexc223 at googlemail dot com
Reported by: craig dot marvelley at boxuk dot com
Summary: getopt() does not reset
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Windows XP
PHP Version: 5.3.1
Block user comment: N
New Comment:
I can also confirm this on PHP 5.3.3
Previous Comments:
------------------------------------------------------------------------
[2009-11-20 14:37:31] craig dot marvelley at boxuk dot com
Description:
------------
A bug that has been reported and fixed in the past regarding getopt not
resetting after being called once has resurfaced.
Here's the original bug: http://bonsai.php.net/bug.php?id=29714
The same behaviour is happening in 5.3.1 - once getopt has been called,
subsequent calls ignore options not included in the original call.
Reproduce code:
---------------
> php test.php -d hello -b world
<?php
$options = getopt("d:");
print_r($options);
$options = getopt("b:");
print_r($options);
Expected result:
----------------
Array
(
[d] => hello
)
Array
(
[b] => world
)
Actual result:
--------------
Array
(
[d] => hello
)
Array
(
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=50244&edit=1