php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36319 getopt() second parameter is never used
Submitted: 2006-02-07 16:02 UTC Modified: 2006-02-08 16:20 UTC
From: lapo at lapo dot it Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: anything but FreeBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lapo at lapo dot it
New email:
PHP Version: OS:

 

 [2006-02-07 16:02 UTC] lapo at lapo dot it
Description:
------------
http://it.php.net/manual/en/function.getopt.php
This page states that as of 4.3.0 PHP has got a second parameter called longopts that should enable getopt_long functionality.

The first problem is that it doesn't have any specific example, and the format of such parameter is not explained at all.

The second, and biggest, problem is that the functionality never made it in any PHP release except 4.3.0pre2 as it was created in version:
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?view=log#rev1.533
and removed 9 days later, in version
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?view=log#rev1.540
by the very author.

Reproduce code:
---------------
% cat test.php 
#!/usr/local/bin/php
<?
$o = getopt('f:hp:', array('file:'));
print_r($o);
?>


Expected result:
----------------
% ./test.php --file=a
Array
(
    [file] => a
)


Actual result:
--------------
% ./test.php --file=a
Array
(
    [f] => ile=a
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-08 16:20 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 11:00:01 2025 UTC