On Fri, May 14, 2021 at 4:44 PM Aaron Piotrowski <aa...@trowski.com> wrote:
>
> My issue is the dual-meaning of ? in the current proposal. In `foo(?, 42)`, 
> the ? represents a single argument, but adding a trailing ? (such as in 
> `foo(?, 42, ?)`) represents any number of arguments. Would it perhaps make 
> sense to make superfluous ? markers an error?
>
> foo(?); // Fine, needed to define a partial with no bound args.
> foo(?, 42); // Ok, binds second arg.
> foo(?, ?, 42); // Ok, binds third arg.
> foo(?, 42, ?); // Error, unnecessary placeholder.
> foo(?, ?); // Error, unnecessary placeholder.
>
> The intention here is to keep the syntax unambiguous.
>
> foo(?) == foo(?, ?) == foo(?, ?, ?) and so forth is not going to be obvious 
> to everyone, so why allow meaningless and misleading syntax.
>
> Cheers,
> Aaron Piotrowski
>

While it's my preference not to use superfluous placeholders they do
no real harm and I do not feel comfortable imposing this preference on
others.

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

Reply via email to