Hi,

On Sat, 2008-01-26 at 16:23 -0500, Robert Cummings wrote:
> And I thought the whole point was for it to not generate a notice. Isn't
> that why the name ifsetor was chosen? Since it's supposed to work like
> isset() by not generating notices?

This thing is not called "ifsetor". From the commit message:

 ?: operator
 [DOC] "expr1 ?: expr1" is a shortcut for: "expr1
 ? expr1 : expr2" as exists in gcc and discussed some time back. Note
 that this is not an implementation ifsetor($var, default). While
 ifsetor would not generate any message for non existing variables or
 array indices the ternary shortcut does. Also the ternary shortcut does
 a boolean evaluation rather then checking for isset(). That way ther
 ternary shortcut can work on any expression while ifsetor can only work
 on variables. Also to be silent one has do do: "@$expr1 ?: $expr2".

I didn't check the docs, if it is documented as "ifsetor" there that's
wrong.

For reasons why there is no "ifsetor" but this operator please check the
archives.

johannes

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

Reply via email to