Re: PHP 7.1 - Address PHPSadness #28?
| From: | Ryan Pallas | Date: | Fri, 18 Sep 2015 15:56:47 +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-88336@lists.php.net to get a copy of this message | ||
On Fri, Sep 18, 2015 at 9:35 AM, Rowan Collins <rowan.collins@gmail.com>
wrote:
>
>
> If what you want to write is "if ( ! exists($foo) || is_null($foo) ) { ...
> }" then that is exactly what "if ( isset($foo) )" will give you, without
> any notices whatsoever.
Conversely, if what you want to write is "if ( exists($foo) &&
is_null($foo) ) { ... }" then there is no way to do that currently.
I personally agree with you Rowan, that this feels like an unnecessary
addition to the language. On the other hand, I see no reason it shouldn't
exist if its a feature users want, especially considering its impossible to
implement in userland.