Re: [RFC][Vote] Typed Properties
| From: | Fleshgrinder | Date: | Wed, 25 May 2016 20:25:45 +0000 |
| Subject: | Re: [RFC][Vote] Typed Properties | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93529@lists.php.net to get a copy of this message | ||
On 5/25/2016 10:23 PM, Benoit Schildknecht wrote:
> Le Wed, 25 May 2016 21:40:28 +0200, Fleshgrinder <php@fleshgrinder.com>
> a écrit:
>
>> and unset simply because the property is not
>> explicitly assigned null by unset, it is being undefined.
>
>
> Because null !== undefined. That's why you get an error after an
> unset($this->var), and you don't get one after $this->var = null; .
> "$var = null;" and "unset($var)" are totally different, it has been like
> that for years. If you want to change this behavior, propose an RFC, and
> make it approve. But meanwhile, you'll have to keep this in mind :
> "null" is a value. While "unset" does not affect a value, it deletes the
> variable, it deletes any references of the variable it targets, the
> variable doesn't exist anymore. With unset, the variable is dead. With
> null, it has amnesia. I can't find any better analogy.
>
Which is exactly what I wrote and think is correct. ;)
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc