Re: Optional parameters without initializer
| From: | Christoph M. Becker | Date: | Tue, 27 Nov 2018 14:30:01 +0000 |
| Subject: | Re: Optional parameters without initializer | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969387093@lists.php.net to get a copy of this message | ||
On 27.11.2018 at 14:37, Nikita Popov wrote:
> On Tue, Nov 27, 2018 at 1:56 PM Christoph M. Becker <cmbecker69@gmx.de>
> wrote:
>
>> Any ideas how to specify non applicable parameter defaults?
>
> 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).
Well, I'd really appreciate fixing the implementation, but that might
cause subtle BC breaks, for instance, if an explicitly passed NULL was
internally converted to a falsey value with some reasonable resulting
behavior, but now the NULL would cause different behavior. And there
are some cases such as call_user_func() which do really have no default.
Anyhow, the docs are currently supposed to document behavior as of PHP
5.0.0, so we'd need respective changelog entries.
Either way, this may be quite some work, since I was able to find 1289
files in en/reference with missing initializers for optional parameters.
O_o
--
Christoph M. Becker