Hi all,

On Thu, Apr 7, 2016 at 9:44 PM, Bob Weinand <bobw...@hotmail.com> wrote:
>> 1) While parameters allow null to be accepted as the default value, null is 
>> never a valid value for a typed property.
>>
>> I think we must have a way to make properties explicitly nullable. Otherwise 
>> we won't be able to define even simple binary tree...
>>
>> class Node {
>>
>>   public Node $left = null;
>>   public Node $right = null;
>> }
>
> Eventually that, but I honestly would prefer to be more explicit with a typed 
> union
>
> public Node | null $left;

Value must be able to be NULL.
SQL has "NOT NULL" constraint. We may have "MAY NULL" and
this syntax seems reasonable choice.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

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

Reply via email to