Do note, using the ternary operator shorthand (since 5.3), omitting the 2nd expression the first expression will only be called once.
Before 5.3 (or not using the shorthand)
<?php
$val = f('x') ? f('x') : false;
// f('x') will be run twice
?>
After 5.3
<?php
$val = f('x') ?: false;
// f('x') will be run once
?>