I would like to have real optional parameters in PHP. I realize that I can do something like this:
function my_function($req_var, $opt_var1 = 90, $opt_var2 = "lala") {
die("WEEEEEEEE!");
}
However, if I want to only specify the value of $opt_var2
, I still must specify a value for $opt_var1
.
Here's an example.
my_function("lala", 90, "omg");
In other words, I have to explicitly write 90
as $opt_var1
even though it's only $opt_var2
that I want to change.
Is it possible to do something like this?
my_function("lala", default, "omg");
That would be so helpful.