Re: [RFC] Replace "Missing argument" warning with "Too few arguments" exception

From: Date: Thu, 02 Jun 2016 08:39:01 +0000
Subject: Re: [RFC] Replace "Missing argument" warning with "Too few arguments" exception
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-93710@lists.php.net to get a copy of this message
On 02/06/2016 00:19, Aaron Piotrowski wrote:
On Jun 1, 2016, at 3:56 PM, Rowan Collins <rowan.collins@gmail.com> wrote: On 01/06/2016 19:36, Aaron Piotrowski wrote:
While this might be considered a BC break, I can't imagine there's an actual code out there relying on suppressing the warning just to call a function without enough arguments. I see no problem putting this change in 7.1.
I think you're overestimating how much people care about their code running without warnings. You don't have to suppress anything, just lazily ignore warnings, or log them to a file you never get round to reading. It *might* be that most users spot and act on the warnings, but I'm not sure how we could know that with any confidence.
Perhaps I'm overestimating how much people care about eliminating warnings, but I doubt many functions work as intended without being supplied all required arguments. The few situations where code worked as intended when too few arguments were provided to a function are fragile and should be fixed. This change will better alert users to those problems.
Sure, but "a good thing in the long run" is not the opposite of "BC break". If people upgrade to PHP 7.1 and get a load of errors, they will just delay adoption of that version. That is not a risk that should be dismissed lightly, IMHO. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#93710) next »