On Tue, 2004-10-19 at 02:42, Christian Schneider wrote: > The only restrictions I see is that it makes the parameter optional as > well (something I don't consider a problem as it is probably desirable > in most cases anyway to be able to leave out an explicit null) and that > it only works if no mandatory parameter follows, e.g. > function method(MyClass $obj = null, $mandatory); > is not possible. Not a real problem either IMHO.
Is it an implementation difficulty that makes that example "not possible"? If not, I don't see a problem with it. It just means the first parameter is optional in the sense that null is allowed. I would be allowed to call "method(null, $param)". "method($param)" would not be legal. In the implementation, all "optional" parameters before the last mandatory parameter would be required to be specified by the caller but allowed to be null. I don't believe the argument that a parameter should be allowed to be optional but not allowed to be specified as null. If I'm allowed to leave out the argument entirely, it doesn't do any harm to give me 2 ways to say I'm leaving out the argument: one by actually not providing an argument and the other by providing a null. There is a subtle difference, but it is a difference that is already difficult make use of in php without func_get_args (not that that's a bad thing). $.02 (well, less than that) - Todd -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php