"Guard" operator like JavaScript in PHP

Viewed 1535

I like to do this in JavaScript:

function (a, b, c) {
    var foo = a || b || c;
    return foo.bar;
}

Is there a quick way to do assignment with fallback or does it require a custom function?

1 Answers
Related