|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80707 function parameter ?t $v not described
Submitted: 2021-02-03 23:35 UTC Modified: 2021-08-06 19:16 UTC
From: Bernhard dot Stauss at Clareon dot de Assigned:
Status: Verified Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-02-03 23:35 UTC] Bernhard dot Stauss at Clareon dot de
From manual page:
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?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-04 11:16 UTC]
I think we should overhaul the "How to read a function definition"

[1] <>
 [2021-02-04 14:16 UTC] 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-08-06 19:16 UTC]
-Status: Open +Status: Verified
 [2021-08-06 19:16 UTC]
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] <>
[2] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 16:01:31 2024 UTC