On 1/4/13 9:41 AM, Nikita Popov wrote:
https://wiki.php.net/rfc/propertygetsetsyntax-alternative-typehinting-syntax
I like the proposal so far.
I'm still a little hesitant about syntax for allowing the setting of NULL values. Since
properties are NULL by default (I wish this were explicit in the docs), these are
_completely equivalent_:
public $f;
public $f = null;
So it bothers me that these would result in different behavior:
public Foo $f;
public Foo $f = null;
Now, all properties with an object type must be NULL initially, so really we're deciding
whether a property can be set *back* to NULL (outside the setter).
We could just make the most common case the default behavior. Otherwise the author must
provide the signature of the setter with/without "= null".
Steve Clay
--
http://www.mrclay.org/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php