Shorthand for isset($var['foo']) ? $var['foo'] : '' I feel like I write this a lot in PHP:

 $val = isset($var['foo']) ? $var['foo'] : '';


Is there a shorter way to write this? I can't use the ternary operator because the conditional is an isset check, not the value of the function itself.
Now three years later we have the Null Coalesce Operator in PHP7:

 $val = $var['foo'] ?? '';


http://3v4l.org/Kcb2A