Bug #76347 [NEW]: getopt() only usable once
| From: | kaishos at gmail dot com | Date: | Wed, 16 May 2018 08:42:23 +0000 |
| Subject: | Bug #76347 [NEW]: getopt() only usable once | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-215283@lists.php.net to get a copy of this message | ||
From: kaishos at gmail dot com
Operating system: ubuntu0.16.04.1
PHP version: 7.0.30
Package: *General Issues
Bug Type: Bug
Bug description:getopt() only usable once
Description:
------------
This affects php 7.0.28 that is default packages with ubuntu, could not
find it in the list
seems that it will not parse more options if you have parsed one.
it has similarity with:
https://bugs.php.net/bug.php?id=35594
Test script:
---------------
create file called test.php and add:
<?php
$fromOpt = getopt("f:");
$toOpt = getopt("t:");
print_r($fromOpt);
print_r($toOpt);
?>
https://bugs.php.net/bug.php?id=35594&edit=1
then run:
php test.php -f -t
Expected result:
----------------
Array
(
[f] =>
)
Array
(
[t] =>
)
Actual result:
--------------
Array
(
[f] =>
)
Array
(
)
--
Edit bug report at https://bugs.php.net/bug.php?id=76347&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76347&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76347&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76347&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76347&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76347&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76347&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76347&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76347&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76347&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76347&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76347&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76347&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76347&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76347&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76347&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76347&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76347&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76347&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76347&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76347&r=mysqlcfg