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
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php