是否可以在php(5)函数调用中跳过具有默认值的参数? [英] Is it possible to skip parameters that have default values in a php(5) function call?
本文介绍了是否可以在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.
这篇关于是否可以在php(5)函数调用中跳过具有默认值的参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文