On 18/09/15 15:54, Rowan Collins wrote:
>> On 18/09/15 15:06, Rowan Collins wrote:
>>> A PHP variable can have all sorts of states, because you can take
>>> advantage of loose typing:
>>>
>>> $date = new DateTime();
>>> $date = null;
>>> $date = 'TODAY';
>>> $date = -1;
>>> $date = M_PI;
>> And isset() returns true for every one but 'null' so how do I identify a
>> variable that isset=null?
> 
> Why do you need to, when you've got all these values to choose from? Why
> concentrate on the thing you can't do, when you could look at the huge
> array of things you can do?
> 
> Yes, if exists() existed, you could use it as an extra state, but it
> doesn't, so you can't.

You don't do much real database coding do you ...

NULL is returned for fields that have no entry on a secondary table, so
the result set NATURALLY returns NULL. We have been living with the fact
that PHP barf's when trying to check for NULL for a long time. There are
a number of ways those variables can be generated and switching off the
notices is currently the only way. exists() has a place in SOME coding
styles which does not require to find the 'NULL' some other way to avoid
the potential notice! Converting it to something else at the database
end is just another hack?

Yes I do things differently, but certainly in Smarty this one has come
up more than once, and the general statement to 'switch of notices' in
production is another questionable restriction.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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

Reply via email to