Req #73481 [NEW]: getopt function argument handling
| From: | rik dot davis at logiqnet dot net | Date: | Tue, 08 Nov 2016 18:05:19 +0000 |
| Subject: | Req #73481 [NEW]: getopt function argument handling | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205246@lists.php.net to get a copy of this message | ||
From: rik dot davis at logiqnet dot net
Operating system: Centos 7.2.1511
PHP version: 5.6.27
Package: Unknown/Other Function
Bug Type: Feature/Change Request
Bug description:getopt function argument handling
Description:
------------
---
From manual page: http://www.php.net/function.getopt
---
Test script:
---------------
Save as test.php
<?php
$opts = getopt("f::");
print_r($opts);
?>
Working Example:
php test.php -ffilename.ext
Breaking Example 1:
php test.php -f filename.ext
Breaking Example 2:
php test.php myarg -f filename.ext
Expected result:
----------------
All examples should return the following;
Array
(
[f] => filename.ext
)
Actual result:
--------------
Working Example:
Array
(
[f] => filename.ext
)
Breaking Example 1:
> Does not allow for options to have space separated singular values.
Array
(
[f] =>
)
Breaking Example 2:
> Does not allow for options to exist after non-options arguments.
Array
(
)
--
Edit bug report at https://bugs.php.net/bug.php?id=73481&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73481&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73481&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73481&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73481&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73481&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73481&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73481&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73481&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73481&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73481&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73481&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73481&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73481&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73481&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73481&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73481&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73481&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73481&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73481&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73481&r=mysqlcfg