Re: [RFC] Replace "Missing argument" warning with "Too few arguments" exception
| From: | Rowan Collins | Date: | Wed, 01 Jun 2016 11:33:19 +0000 |
| Subject: | Re: [RFC] Replace "Missing argument" warning with "Too few arguments" exception | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93673@lists.php.net to get a copy of this message | ||
On 01/06/2016 11:55, Dmitry Stogov wrote:
hi, Please take a look into the proposal. https://wiki.php.net/rfc/too_few_args The RFC is extremely simple (both proposal and implementation) and almost completely described by the email subject. I think, this mini-RFC doesn't need 2-weeks discussion period, so I'm going to start the vote on next week.I like the concept behind this, but I worry it might have a rather large BC impact. Like removing call-time pass-by-reference, there may be a lot of long-untouched code that needs fixing to work within this constraint. I'm not even sure how easy it would be for static analysis to identify these cases. I guess on the flip-side, people will *probably* have Warnings displayed or logged already... The RFC would also benefit from more discussion of the current behaviour in different cases: function foo($a) {} foo(); // Warning function bar(A $a) {} bar(); // Error function baz(A $a=null) {} baz(); // OK function quux(?A $a) {} quux(); // Not sure. Error? function wibble(int $a) {} wibble(); // Error (regardless of strict_types, I think) function wobble(?int $a) {} wobble(); // Error? Any other cases? Certainly, making these consistent would be nice, but like a lot of consistency, does it come at too high a price? Regards, -- Rowan Collins [IMSoP]