Hello,

  Consider this:   public function foo(MyClass $o)

  If you allow null, false, or anything else, you must CHECK it before
  using it or you will get a "calling a method on a non-object" first.

  The whole point of having a type hint, from my point of view, is so
  the majority of time I DO NOT have to check the incoming parameter
  before using it.

  If nulls or false's are allowed, without explicitly saying they are,
  such as  function foo(nullable MyClass $o),  then I'll have to either
  do an  is_null()  or  instanceof  check on each parameter.

  I'm all for it if we have an option added to the function syntax
  such as nullable, but otherwise, it's usefulness is minimized.

-- 
Best regards,
 Jason                            mailto:[EMAIL PROTECTED]

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

Reply via email to