RE: [PHP-DEV] Type hints with null default values
| From: | Cristiano Duarte | Date: | Sat, 16 Oct 2004 22:00:52 +0000 |
| Subject: | RE: [PHP-DEV] Type hints with null default values | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13352@lists.php.net to get a copy of this message | ||
Robert Silva wrote:
> I think Marcus B's final comments in the original discussion are right on
> track.
>
> Stab: I voted for NULL type hinted arguments before I voted against them.
>
> The main thing that changed my mind, is that in PHP there is no such thing
> as a NULL object. I came to the conclusion that PHP wasn't broken, my
> programming style/code was.
>
> My opinion is that they should stay as they are now although personally.
>
> Now with that said, I do think there needs to be a method to allow a type
> hinted parameter to be optional (but not necessarily null).
That's what I'm asking for. :-)
I'm not asking for null objects, just an optional parameter that must be an
object or a "null" reference.
All OO languages I've ever programmed had this kind of reference(Java, C++,
Delphi, etc.)
Cristiano Duarte