Re: [RFC][Vote] Typed Properties
| From: | Niklas Keller | Date: | Wed, 25 May 2016 17:28:45 +0000 |
| Subject: | Re: [RFC][Vote] Typed Properties | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93520@lists.php.net to get a copy of this message | ||
Andrea Faulds <ajf@ajf.me> schrieb am Mi., 25. Mai 2016 19:14:
> Hi Niklas,
>
> Niklas Keller wrote:
> >>
> >> There is a difference between not set and no meaningful value.
> >>
> >
> > In PHP, there's no such difference for properties. And I think we should
> be
> > consistent with the existing behavior here.
>
> That's not quite true, unset properties produce a notice when accessed,
> properties set to null do not, and it is possible to check whether a
> property is set or not versus just null. Likewise with variables, array
> members, etc.
>
We're talking about two different things. Once it's the default value after
declaring it with private ?Type $foo and on the other hand the behavior
after unser. IMO the first should default to null while unsetting a typed
property should fail.
Thanks.
>
> --
> Andrea Faulds
> https://ajf.me/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>