Re: Return type hints
| From: | Terje Slettebø | Date: | Thu, 14 Sep 2006 17:45:31 +0000 |
| Subject: | Re: Return type hints | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25692@lists.php.net to get a copy of this message | ||
> Terje Slettebø wrote:
> > The above was a contrived example, meant to illustrate the point. What's
so
> > bad about it? That it doesn't check the return value?
>
> I am not worried about the return value of the method. I am concerned
> that $this->something is unset yet does not throw a notice. This is
> only true for properties of objects. Any other variable in PHP does not
> behave this way. IMHO, PHP should either initialize that variable to a
> default type and value or throw a notice when you try and use it without
> setting its value.
I completely agree. :) _Then_ I understood you; I thought you meant my
example(code) was "crap"... :)
Another weird thing of PHP's implementation of OO is that propagation of
constructor calls to the base class is not ensured, something I can't for
the life of me understand why, but that deserves its own thread...
Regards,
Terje