5 ms·
I can't say I like the solution for parameter skipping though... I disagree with the author -- many optional arguments is not a problem IMO This is a problem a
by devgutt 14y ago
I can't say I like the solution for parameter skipping though... I disagree with the author -- many optional arguments is not a problem
IMO This is a problem and bad design, because instead of default arguments you can use properties for optional arguments.
- swivelmaster 14y agoOr encapsulate excess arguments in objects that represent the data that needs to be moved around, if possible.
- smsm42 14y agoYou can, but: some function already exist with existing APIs - especially in libraries and existing internal PHP functions - and currently there's no way to say "I want default for the second parameter, but non-default for the third", unless you copy-paste the default from the docs.