Re: [RFC] skipping optional parameters
| From: | Alan Knowles | Date: | Wed, 18 Apr 2012 01:11:08 +0000 |
| Subject: | Re: [RFC] skipping optional parameters | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60145@lists.php.net to get a copy of this message | ||
On Wednesday, April 18, 2012 06:54 AM, Stas Malyshev wrote:
Hi! https://wiki.php.net/rfc/skipparams Basically, it allows you to do this: create_query("deleted=0", "name",,, /*report_errors*/ true); Implementation of it is here: https://github.com/smalyshev/php-src/tree/skip_params All things described in RFC seem to be working, please tell me if I forgot anything. If it's accepted I'll also add tests, etc. of course. Hate to be contrary, it does raise a few questions.a) it kind of encourages using long lists of arguments (which is not normally regarded as good practice) b) the usual recommendation for solving that issue is to accept an array (fake named arguments) c) the current situation would syntax error out on ,, as a function call argument, which is handy if you accidentally typed ,, twice by accident. if this changes, not only would you loose this syntax error, but it would do unpredictable things. For my 2c, does not look like a very good idea.. Regards Alan