On 21.09.2018 at 17:25, Rasmus Schultz wrote: > this doesn't provide *any* additional guarantees: > > class Foo { > public int $bar; > } > > $foo = new Foo(); // invalid state allowed > > $foo->bar = 123; // valid state > > $foo->bar = null; // invalid state NOT allowed?! > > [snip] > > In terms of reliability, it's actually sub-par to hand-written accessors.
You have no guarantee that a declared public property even exists (regardless of the Typed Properties 2.0 RFC), because it might have been unset. And no, the property is not really NULL in this case, but rather undefined. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php