Is it possible to skip parameters that have default values in a php(5) function call?

后端 未结 5 1743
长情又很酷
长情又很酷 2020-12-02 00:22

I have this:

function foo($a=\'apple\', $b=\'brown\', $c=\'Capulet\') {
    // do something
}

Is something like this possible:



        
5条回答
  •  忘掉有多难
    2020-12-02 00:57

    You pretty much found the answer, but the academic/high-level approach is function currying which I honestly never found much of a use for, but is useful to know exists.

提交回复
热议问题