Re: Passing null for a class-typed argument renders catchable error ?!?
- From: Michael Fesser <netizen@xxxxxx>
- Date: Sun, 13 Jan 2008 22:58:46 +0100
..oO(Peter Pei)
buggy. inconsistent lang design
Wrong. It's not inconsistent, it's just not properly documented.
The behaviour is perfectly logical and quite useful if you know it:
public function foo(TBar $obj) {}
=> You must pass a TBar object.
public function foo(TBar $obj = NULL) {}
=> The parameter is optional, but if you pass something, it must be an
object of class TBar.
That's how I want it.
Micha
PS: Please learn to quote properly. Your posting alone taken out of
context is meaningless.
.
- Follow-Ups:
- References:
- Prev by Date: Re: Passing null for a class-typed argument renders catchable error ?!?
- Next by Date: Re: Two Submit buttons on one form
- Previous by thread: Re: Passing null for a class-typed argument renders catchable error ?!?
- Next by thread: Re: Passing null for a class-typed argument renders catchable error ?!?
- Index(es):
Relevant Pages
|