Just one point of feedback: for clarity I think it would be good if it mentions that creating dynamic properties i.e. $this->dynamicProp = 'bar' would also throw at runtime (or even compile time if doable?).
Absolutely. I'll include a note about this in the RFC.
On second thoughts, I don't think dynamic properties can apply at all. The notion of
$this
is a reference to an object instance; static classes cannot be instantiated, so the concept of dynamic properties simply cannot exist, and that's really all there is to it 😅 (unless I'm missing something).
Yeah sorry that is indeed not needed as it already works that way