isset() works on a variable only too, so this behavior matches already existing behavior.
Hmm... this brings up another idea:
Extend isset to have this behaviour. Funnily enough when I was thinking about such a feature I wished I could call it isset. And now I realize that we could:
Extend isset to accept multiple arguments and make it return the value of the first non-null it any.
Backward compatible for everything but variations of the horrible
if (isset($a) === true)
This would lead to $a = isset($b, 'default');
I'd also propose to extend this to a whole list of expressions:
no thanks.
Any reasons for this? I can think of situations where you have data from 3 different sources, e.g. $_REQUEST, a DB and a default:
$a = isset($_REQUEST['value'], $DB->get('value'), 'default');
that looks too perlish. Be happy with what we came up with now.
That doesn't look perlish, it *is* Perl. Perl 6 actually (-:C
But now that I thought of isset() I have no desire for an operator any more...
- Chris
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php