Py学习  »  Python

php python样式的函数变量[重复]

tolgatasci • 5 年前 • 1818 次点击  

PHP 4/5在调用、跳过不想指定的参数时是否可能指定一个命名的可选参数(如在Python中)?

类似于:

function foo($a,$b='', $c='') {
    // whatever
}


foo("hello", $c="bar"); // we want $b as the default, but specify $c

谢谢

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/46202
 
1818 次点击  
文章 [ 17 ]  |  最新文章 5 年前