I like "void", as "null" can be ambiguous.
Imagine function example($a = 'default value 1', $b = 'default value 2')
{}
With "void", we can allow skipping arguments in advance to the default
pamameter value like example(void, 'test');.
With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,

Michael Voříšek

On 2 Sep 2020 16:24, David Rodrigues wrote:

I think "void" is a good solution and is very clear, compared to "_".

[void, void, $username] = getUserData();

Atenciosamente,
David Rodrigues

Em qua., 2 de set. de 2020 às 10:57, Dik Takken <dik.tak...@gmail.com>
escreveu:

On 02-09-2020 15:35, Chase Peeler wrote: Isn't the underscore an alias for gettext()? You are right, it is. Now this does not necessarily mean that underscore
cannot be used for ignored variables. Depending on the context in which
it is used an underscore may or may not be ambiguous.

Since we are talking about using underscore in places where a variable
name is expected, there may not be any problem at all. But we should be
aware of all cases in which ambiguous syntax could emerge and identify
any issues. So thanks a lot for pointing out this possible trouble maker!

Regards,
Dik Takken

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to