Hello John, we are not testing against NULL here. We check for existance. That would be having a uniform sql way to test the existance of a table or column in a table. Hence IFNULL(), NOT IFNULL(), NVL() are different. I also explained several times why coalesce doesn't apply.
Friday, July 9, 2004, 6:42:10 PM, you wrote: > Hi, > I would suggest another name for ifsetor. > In relational databases, there is a similar function, called NVL in oracle, > and IFNULL in MySQL and coalesce in postgresql for testing for null, and > returning a default value if the variable is null. > I think ifsetor sounds a big ugly. I would suggest ifset($var, > $defaultvalue), as there are historical analogies with mysql's > IFNULL function, and i think ifset looks different enough from > isset, thanks to the tall 'F'. read top...IFNULL === is_null which has nothing to do with isset() > $var = isset($aval) ? $aval : 0; > $var = ifset($aval, 0); That suggests it returns 0 if $val is set and not what you describe above. To explain why i chose "ifsetor" try to read it as: "if" <var> "set" return it "or" return <expr> regards marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php