I want to define a function doSomething(arg1, arg2) with default values to arg1=val and arg2=val
When I write
function doSomething($arg1="value1", $arg2="value2"){
// do something
}
Is it possible now to call doSomething with default arg1 and arg2="new_value2"
Optional Parametersmove over to ASP.Net 4.0 ;)named parameterswhere you could, as a PHP example, calldoSomething($arg2="value2"). This is valid PHP syntax but do not be fooled into thinking it works as a named parameter.