Re: Optional parameters without initializer
| From: | Nikita Popov | Date: | Tue, 27 Nov 2018 13:37:09 +0000 |
| Subject: | Re: Optional parameters without initializer | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969387092@lists.php.net to get a copy of this message | ||
On Tue, Nov 27, 2018 at 1:56 PM Christoph M. Becker <cmbecker69@gmx.de>
wrote:
> Hi!
>
> Several function signatures in the PHP manual show optional parameters,
> but are missing initializers. Grepping for these is easy, so we could
> add the missing initializers “once and for all”, but the problem are
> those optional parameters which do not support any default which could
> be specified in PHP. For a few of these cases it seems appropriate to
> split the function signature (for instance, like done for
> array_search()[1]), but for others (for instance, string parameters
> which default to C NULL)?
>
> I tried adding an empty initializer element, but that is rendered by PhD
> as equal sign without a value. <initializer>n/a</initializer> might
> also be misleading to readers of the signature.
>
> Any ideas how to specify non applicable parameter defaults?
>
> [1]
> <http://svn.php.net/viewvc?view=revision&revision=346086>
>
We should use = null, and additionally make sure that this is really
accepted as a way to specify the default in the implementation (it's not
always the case, as it may require an explicit "!" in zpp).
Nikita