Re: what happened to that new isset() like language
| From: | John Lim | Date: | Fri, 09 Jul 2004 16:42:10 +0000 |
| Subject: | Re: what happened to that new isset() like language | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-11031@lists.php.net to get a copy of this message | ||
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'.
$var = isset($aval) ? $aval : 0;
$var = ifset($aval, 0);
Thanks, John
"Daniel Crookston" <daniel@hyperion-data.net> wrote in message
news:007201c4655d$283125d0$6601a8c0@calhoun...
> Why not just call it the issetor, or the setor operator? Also, why does
> www.php.net/ternary not link to what one would assume it might link to?
We
> could do the same with www.php.net/setor.
>
> Dan
>
> > But the fact still remains that if we did go with
> > this syntax, we could and probably should find a name for it.