> > > > So you are saying that your (teams) IDE doesn't tell you the method > > signature which contains also the default values? > > I guess that the fact that many of the php core functions have optional > > arguments and non null defaults must be really a PITA for you. > > I think what he was alluding to is the problem where one changes the > default.
All usages of the method/function then need to be updated. Using null today > is very much like using the proposed 'default' parameter skipping RFC. > true, using null as a default value for your optional arguments means that you don't really need the parameter skipping RFC (at least for the functions that you control) or the named params, because you can pass null for the in-between optional arguments. ofc. most modern IDEs also have some kind of refactoring feature, which would make it easier for you to update the function calls to reflect the change in the default value, but it would be harder to tell the original intention ($limit is 30 here, because it was the default and the caller wanted to set the next optional argument, or $limit is intentionally set to 30 and the next optional argument also happen to be needed). thanks for clearing that one up for me. Having every optional argument defaulting to null means that it can be frequent scenario, when you have a variable, which is guaranteed to be defined, but can be null. But I still think that it isn't that frequent that you want to keep the non falsely values or set a default value otherwise. I mean if you expect a number, then you don't want your passed 0 to be replaced with the default, or if you expect a string, you don't want "0" or maybe even "" to be replaced with the default, etc.. So you couldn't use the ternary assignment for those scenarios. -- Ferenc Kovács @Tyr43l - http://tyrael.hu