1

In C# you can pick and choose your parameters by name, like so:

public void Foo(int b = 0, int a = 1, int r = 2) {
    print(b + ", " + a + ", " r);
}

Foo( b: 1, r: 7 );

which would result in the numbers

1, 1, 7

being printed out, skipping the default variable "A".

I was wondering if this was possible in php, because passing the default value when you don't need to use it seems redundant.

Hobbyist
  • 15,888
  • 9
  • 46
  • 98

0 Answers0