This is more curiosity than pragmatic.
That said, the below function accepts 3 arguments the second and third of which have default values and are optional.
function doStuff( $param1, $param2='default', $param3='value' ){
// do stuff ....
}
Is there a way to call doStuff
and provide values for $param1
and $param3
but have $param2
retain its default value
Im thinking something like doStuff('new',$placeholder,'value')
Where inside the function the values would now be 'new','default','value'
Is this possible, or must you explicitly pass a value for 2 to get to 3?
Like I say, I'm more curious than actually needing this.