Doc #80707 [Opn->Ver]: function parameter ?t $v not described
Edit report at https://bugs.php.net/bug.php?id=80707&edit=1
ID: 80707
Updated by: cmb@php.net
Reported by: Bernhard dot Stauss at Clareon dot de
Summary: function parameter ?t $v not described
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
That page[1] is really bad; it starts with
| Information may be passed to functions via the argument list,
| which is a comma-delimited list of expressions.
What is close to nonsense. It does not even mention type
declarations, except for variadics:
| It is also possible to add a type declaration before the ...
| token.
A pull request[2] for improvement is welcome!
[1] <https://php.net/functions.arguments>
[2] <https://github.com/php/doc-en/pulls>
Previous Comments:
------------------------------------------------------------------------
[2021-02-04 14:16:41] Bernhard dot Stauss at Clareon dot de
First: Thank you for the hint to nullable type.
Second: The doc is good to get a help, if you are a more or less experienced php-developper and have
a specific question. The doc may not be intended to be read in the given sequence.
------------------------------------------------------------------------
[2021-02-04 11:16:25] cmb@php.net
I think we should overhaul the "How to read a function definition"
section[1].
[1] <https://www.php.net/manual/en/about.prototypes.php>
------------------------------------------------------------------------
[2021-02-03 23:44:26] tiffany@php.net
https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.nullable
------------------------------------------------------------------------
[2021-02-03 23:35:35] Bernhard dot Stauss at Clareon dot de
Description:
------------
---
From manual page: https://php.net/functions.arguments
---
The manual page says no single word about function parameters declared as
?<type> $<param-name>
where <type> is the data type of the parameter
and <param-name> is the name of the parameter.
What is the meaning of such a parameter declaration?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80707&edit=1
Thread (5 messages)