On Wed, Aug 26, 2015 at 12:07 PM, Craig Francis <cr...@craigfrancis.co.uk> wrote:
> > On 26 Aug 2015, at 16:06, Rowan Collins <rowan.coll...@gmail.com> wrote: > > > Craig Francis wrote on 26/08/2015 14:53: > >> On 26 Aug 2015, at 12:36, Rowan Collins <rowan.coll...@gmail.com> > wrote: > >> > > >> where NULL may be a perfectly valid value. > > > > It's not that NULL isn't a valid value; it's that "doesn't exist" isn't > a meaningful state for a variable. It's like checking if the current line > number is greater than 100, it shouldn't mean anything to the compiled > program. See the SO answer I linked earlier for more thought experiments > along these lines. > > > I think you have been spending too much time in C. > > Most of the PHP code bases I've worked on set variables to NULL at some > point (and they are not calling unset, because that isn't the intention). > > I think there is a misunderstanding here that is drawing this out. Assigning meaning to NULL in any language is wrong. That is why it should be treated as if the variable didn't exist and isset is appropriate. This is a common pitfall in database design as well where you can allow NULL as a field value. Assigning meaning to to that NULL value can quickly lead to problem. > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >