On Mon, Mar 16, 2020 at 4:47 AM Rowan Tommins <rowan.coll...@gmail.com> wrote:
> I'm sure different people will react differently, but my intuition is quite
> the opposite: I would probably call the inline assignment to the property
> an "initial value", not a "default value", and I would intuitively compare
> it to assigning it in the constructor. I would also understand the intent
> of "write once" to be "once initialized, can't be overwritten", so would
> personally have no expectation that I could initialize a variable in both
> the property definition and the constructor.

Interesting, so if I understand you correctly, you think of a property with an
initial/default value to be *initialized* before the constructor, but
a property without it is
*initialized* in the constructor or later (at first assignment of value)?

Is this concept of initialized/non-initialized properties something that is
more or less well-described in the language? If so, I'd like to read it.
Seems like a fuzzy concept to me so far, unfortunately...

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

Reply via email to