At 11:03 PM 9/6/2003 +0200, Marcus Börger wrote:
> What needs to be discussed ? Typehinting works with NULL values (It's
> working for me), or am I wrong?

The point was that it doesn't make sense for values passed by reference and
that maybe someone doesn't want to allow NULL which is IMO the normal case.
Because with type hinting you say you want an instance of a certain class
and you didn't say something about NULL. The idea was then to allow NULL
only if that's the default value.

I think that there is no right way. What I would like to see is:
a) Type hints allow the type and null (in objects), i.e. method(MyClass $obj)
b) Add an option of writing "not null" to make the type hint not allow null. i.e. method(MyClass $obj not null)


Andi

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to