是否可以在php(5)函数调用中跳过具有默认值的参数?
问题描述:
我有这个:
function foo($a='apple', $b='brown', $c='Capulet') {
// do something
}
是否可能这样:
foo('aardvark', <use the default, please>, 'Montague');
答
发现了这一点,可能仍然正确:
Found this, which is probably still correct:
http://www.webmasterworld.com/php/3758313.htm
简短回答:否.
长答案:是的,上面概述了各种杂乱的方式.
Long answer: yes, in various kludgey ways that are outlined in the above.