On Thu, Apr 4, 2024 at 2:16 PM Bilge <bi...@scriptfusion.com> wrote:
> 
> On 04/04/2024 16:57, Tim Düsterhus wrote:
>> I think it would be reasonable to consider deprecating passing extra
>> arguments to a non-variadic function.
> 
> This seems like the only reasonable thing to do, to me. If this were the
> case, there should be no need for any new syntax, since we could simply
> deny passing extra arguments in the next major, no?
> 
> Bilge

I'd caution about being too hasty to deprecate and remove support for
this feature without understanding the underlying reasons why it has
been used historically, and without providing a better (not just
different) alternative for those use cases, lest an impossible upgrade
path is created.

While the variadic operator should be a 1:1 replacement for using
func_get_args(), is it enough of a benefit to force potentially tens
of thousands of codebases to change when they both accomplish the same
thing? What bad thing happens if PHP continues to support both
methods?

There is already enough friction to upgrade between major versions.
Introducing an optional attribute or syntax allows codebases that care
about signature strictness get that safety, while avoiding a
potentially costly and onerous upgrade for the community.

- Mark

Reply via email to