Making NULL a scalar

From: Date: Fri, 22 Nov 2002 00:04:51 +0000
Subject: Making NULL a scalar
Groups: php.dev 
Request: Send a blank email to php-dev+get-91444@lists.php.net to get a copy of this message
It seems like the NULL type is a scalar type, ie it has a discrete set of values. I suppose from an SQL perspective, one could argue NULL is a special value that destroys any attempts at evaluation. However, PHP has a precedent that relates to this issue: the ctype functions. For example, is_alpha('') is TRUE...of course, because the null set is always a part of every set (in textbook mathematics, anyway). Anyway, the is_scalar() function is currently returning FALSE when passed a NULL value. May I suggest adding the IS_NULL constant to the top part of this function's case statement? I'm not sure if this has negative BC issues. I don't feel particularly passionate about this issue, it just occurred to me as I was reviewing the function. Comments? Thanks, Leon --- Leon Atkinson <http://www.leonatkinson.com/>

« previous php.dev (#91444) next »