>> I also don't like the `?` for `nullable`.  Just stick with PHP
>> convention and do:
>>
>>      class Foo {
>>          public Bar $bar = NULL;
>>      }
>
>
> There is no such PHP convention. The PHP convention is *not restrict type*
> (+"loosely typed" addons).
> So NULL is automatically allowed.

For properties, yes, but the idea it stems from is type-hints. Given
the following type-hint, passing a null is not allowed:

    class Foo {
      function bar(Bar $bar) {}
    }

Whereas in the following NULL is allowed:

    class Foo {
      function bar(Bar $bar = NULL) {}
    }

This is what I mean by the PHP convention for allowing NULL.

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

Reply via email to