On Sat, Jan 5, 2013 at 12:31 AM, Steve Clay <st...@mrclay.org> wrote:
> Would the following two be exactly functionally equivalent? > > public Foo $foo; > > public $foo { > get; > set(Foo $value) { $this->foo = $value; } > } > > We should also consider how an author would allow type-hinted properties > to accept NULL as a new value, in both proposals. > I think that's a very interesting question, thanks for bringing it up. I think a good approach here would be the same one used for function argument typehints, i.e. allow NULL when NULL is specified as the default value. So `public DateTime $date;` would not allow an explicit NULL assignment, whereas `public DateTime $date = NULL;` would. Nikita