Re: what happened to that new isset() like language
| From: | Christian Schneider | Date: | Thu, 08 Jul 2004 20:42:51 +0000 |
| Subject: | Re: what happened to that new isset() like language | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10990@lists.php.net to get a copy of this message | ||
Marcus Boerger wrote:
As i wrote before several times before to me this seems impossible. But maybe someone can come up with a working patch?I'll have a look at it as soon as I find time (not this week anyway). What I'm looking for is the equivalent of coalesce($a, $b) == @($a ? $a : b) or coalesce($a, $b, $c) == @($a ? $a : ($b ? $b : $c)) e.g. a silenced version of a multi-value ?: operator. Or to go back to my initial example coalesce($_REQUEST['x'], $db->get('x'), 'default_x') == @($_REQUEST['x'] ? $_REQUEST['x'] : ($_x = $db->get('x') ? $_x : 'default_x')) This is definitely not impossible and I consider the silencing of the whole function call inside the coalesce() construct a non-problem. (If someone wanted to do a version where stuff inside function calls aren't silenced any more then one'd need to track the nesting level. I myself wouldn't care.) - Chris