|
Posted by Andy Hassall on 06/19/06 23:23
On Mon, 19 Jun 2006 19:16:06 -0400, Bob Stearns <rstearns1241@charter.net>
wrote:
>Andy Hassall wrote:
>> On Mon, 19 Jun 2006 17:50:52 -0400, Bob Stearns <rstearns1241@charter.net>
>> wrote:
>>
>>>Consider a function header:
>>>
>>>function init($name, $ttl, $need_bhid="N", $need_entity_id="N")
>>>
>>>What values do the last two parameters have when it is called with the
>>>following arguments:
>>>
>>>init("name", "do name",,"Y");
>>
>> That's a syntax error.
>
>That is too bad. It really should be "N" and "Y" with PHP honoring the
>default values for all omitted arguments, not just trailing ones. Does
>PHP v 5.x do it better?
No, C++-style skipping arguments in the middle of a list of arguments with
defaults is not supported in any current version of PHP.
(I don't know whether will be or not in PHP 6).
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|