Hi!

> * uninitialised - the constructor (or indeed, other code) is yet to set it
> * null - the property is left intentionally empty

For declared properties, this always has been the same, and I'm not sure
why would we want to change that. This also has a potential to be a huge
BC break if we change it not to be the same, since pretty much all the
code assumes it is the same. We'd essentially have to invent another
null, which is exactly the same as null but isn't null. I don't see a
reason to do this.

> * some other value - the property is intentionally given a value
> 
> A simple example might be a Lisp-style linked list cell:
> 
>     class LinkedList
>     {
>         public int $head;
>         public ?LinkedList $tail;
>     }
> 
> In a properly initialised LinkedList, the $head is some value, and the
> $tail is either another linked list (the remainder of the list), or null
> (we're at the end of the list).

This is a very weird list, as it can't be empty.
-- 
Stas Malyshev
smalys...@gmail.com

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

Reply via email to