Re: Add E_STRICT when defining a required function parameter after an optional parameter
| From: | Stas Malyshev | Date: | Wed, 24 Nov 2010 19:02:45 +0000 |
| Subject: | Re: Add E_STRICT when defining a required function parameter after an optional parameter | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50478@lists.php.net to get a copy of this message | ||
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. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227