> Le 25 mai 2021 à 18:23, Kamil Tekiela <tekiela...@gmail.com> a écrit :
> 
> Hi Internals,
> 
> I'd like to start a discussion on the following RFC
> https://wiki.php.net/rfc/autovivification_false
> Particularly, I am looking for opinions on whether this behaviour should be
> left alone, should be disabled on false, or should be disabled on null and
> false, and left only for undefined variables.
> 
> Autovivification is very useful in PHP, especially with multidimensional
> arrays and loops. However, the question is should we allow it on false and
> null values going forward.
> 
> Kind Regards,
> Kamil Tekiela

Hi,

* IMO, null and undefined should be treated the same way, because for many 
purposes, they are not distinguished (e.g., isset() and ??). In general, I’m 
setting something to null when I want to avoid an “Undefined symbol” notice, I 
am sure it is not a bug, and I don’t want to scatter my code with `isset()` or 
`??` checks.

* In any case, the removing of the autovivification behaviour MUST be preceded 
by a period of deprecation notices.

—Claude
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to