|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80622 Optional argument brackets
Submitted: 2021-01-13 13:35 UTC Modified: 2021-02-21 16:21 UTC
From: grzesiek at gbankowski dot pl Assigned: cmb (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
 [2021-01-13 13:35 UTC] grzesiek at gbankowski dot pl
Dear PHP webmasters,

I'm writting to inform that, in all funcions disappeared brackets [] for optional arguments. Why?

sscanf ( string $string , string $format , mixed &...$vars ) : array|int|null

$vars is optional, but where are brackets?

Best regards

Test script:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-13 13:42 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-01-13 13:42 UTC]
This has been done to match PHP's syntax for user defined
functions more closely[1].

[1] <>
 [2021-01-13 13:54 UTC]
Actually, this case is not related to the mentioned PR, but rather
because variable-length argument lists[1] can be empty.

[1] <>
 [2021-01-13 16:48 UTC] grzesiek at gbankowski dot pl
Let's look at crypt function:

crypt ( string $string , string $salt ) : string # current documentation

and look at previous documentation:

crypt ( string $str [, string $salt ] ) : string # in this case we know that second argument is optional. In current version we don't know.
 [2021-01-13 16:59 UTC]
This argument is no longer optional as of PHP 8.0.0[1].

[1] <>
 [2021-01-14 04:57 UTC] grzesiek at gbankowski dot pl
I understand. I'm preparing for Zend Certified PHP Engineer exam, which bases on PHP 7.1. It is possible to read or download old documentation for this version? Thank You very much in advance.
 [2021-01-14 11:13 UTC]
There is no readily downloadable or viewable documentation for PHP
7 only.  However, you can checkout an older revision of the doc
repo[1], and build the documentation yourself[2].

[1] <>
[2] <>
 [2021-02-21 16:11 UTC] grzesiek at gbankowski dot pl
I can't rebuild documentation for PHP 7.1. I haven't enough knowledge to do this. This documentation was available as tar.gz, one html, many html, zip files to download. I thought, that there are some archive with older documentation. Thank You very much for help, Your assistance.
 [2021-02-21 16:21 UTC]
Then consider to use the documentation available at Zend[1],
or download the archived docs[2].  While both are named PHP 5
documentation, they already contain a lot of documentation
about PHP 7.

[1] <>
[2] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 17:01:23 2021 UTC