Hi!
However, what are the benefits to be less strict in your example? I can't think of any practical (or critical) example where you have to remove this optional argument.
I have tons of code that does it, but the first example would be, of course, using func_get_args(). Another example would be if the parent function has some option and the child want to always have this option set to particular value or maybe taken not from the parameter but from some other place. He can do it in the code anyway, but why have an argument that is never used?
The idea is that E_STRICT warning are useful if they definitely point to some wrong code - like overriding foo($a) with foo($a, $b) (can't work - missing arg) or with foo(Bar $a) (can't work if $a is not Bar). In the example we discuss it definitely can work and actually does work - only reason to put out warning there will be misguided notions of how the code should be written and it ultimetely would lead people to just disable those warnings altogether - who needs them if they warn about perfectly good code and serve no purpose but to annoy people?
These things are only useful if they help. The whole notion of "you have to prove this code is legit" is wrong - even though, as I showed above, I can prove it's legit - we should only warn about the code *we* can prove is *not* legit. Which is definitely not the case here.
-- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php