Tuesday, 1 October 2013

Named function parameters in PHP

Named function parameters in PHP

Is it possible in php like in python to have named function parameters? An
example use case is:
function foo($username = "", $password = "", $timeout = 10) {
}
I want to override $timeout:
foo("", "", 3);
Ugly. I would much rather do:
foo($timeout=3);

No comments:

Post a Comment