> Robert Silva wrote: > What I propose is something like: > > if the typehinted parameter is optional and the user doesn't pass it, the > only "type" it can have (at least now) is "null". So, if you, as a > developer, want a function to have optional typehinted parameters, you must > check for null to test if the user passed the parameter or not, IMHO it's > logical. > > function f(Obj $a, Obj $b=null, Obj $c=null) {...} > You can't call f(null) since the first argument is mandatory, typehinted and > doesn't allow nulls, but you can call f(new Obj(), null, new Obj()) since > the second argument is optional and allow nulls(the notation =null).
I totally agree with you. IMHO this is exactly how it should work. I've actually been waiting for this feature for a while now, so I'm glad the discussion is active again. Ron -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php