Re: Add E_STRICT when defining a required function parameter after an optional parameter
| From: | Etienne Kneuss | Date: | Thu, 25 Nov 2010 02:03:33 +0000 |
| Subject: | Re: Add E_STRICT when defining a required function parameter after an optional parameter | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50488@lists.php.net to get a copy of this message | ||
On Nov 24 11:02:45, Stas Malyshev wrote:
> Hi!
>
> >Given the semantics of PHP arguments, there is "nothing wrong" with
> >defining a required argument after an optional one, and in some cases
> >it is required. Consider:
>
> I think there's something wrong with it, primarily - the fact that
> it doesn't really make any sense. The object/null thing is a kludge.
> Unfortunately, I don't see a proper way to handle this without named
> arguments.
Sure, it's hackish as hell, but that's PHP's fault, not the user using
it.
My point is that we shouldn't add new E_STRICTs for something with no
possible alternatives.
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
--
Etienne Kneuss
http://www.colder.ch