Re: PHP 7.1 - Address PHPSadness #28?
| From: | François Laupretre | Date: | Wed, 16 Sep 2015 12:43:19 +0000 |
| Subject: | Re: PHP 7.1 - Address PHPSadness #28? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88233@lists.php.net to get a copy of this message | ||
Le 16/09/2015 14:23, Rowan Collins a écrit :
I would say encouraging devs to treat unset($foo) and $foo=null as distinct states is an extremely bad idea.I don't see it this way but, if unset and null states should absolutely be considered the same, why don't we add array_key_isset()/property_isset() and deprecate the xx_exists() functions ? More : why don't we modify the core so that an unset variable returns null, instead of an error ? I understand this is not possible but it would be more consistent with Stas' and your position. What I don't understand is why considering unset and null as distinct states 'is is an extremely bad idea'. Don't get me wrong, I really don't see the potential problems. Regards François