> On 19 09 2015, at 23:22, Rowan Collins <rowan.coll...@gmail.com> wrote:
> 
> On 19 September 2015 15:49:55 BST, Lester Caine <les...@lsces.co.uk> wrote:
>> On 19/09/15 13:15, Rowan Collins wrote:
>> If there was a bug with 'isset' it is that it returns false for a
>> variable that IS SET to null.
> 
> I honestly think that the only problem there is the name. If instead of 
> isset() and empty() we had quiet_is_null and quiet_boolval, nobody would be 
> the slightest bit surprised by their behaviour, and people looking to see if 
> an array key exists would be more likely to find array_key_exists.
> 
> 
>> if the variable does not exist there is no way of testing for that
>> state
>> prior to calling is_null()
> 
> Correct, there is no way of testing for that full stop.

There is, though, not sure if already mentioned:

array_key_exists(“var”, get_defined_vars()) && is_null($var)



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

Reply via email to