Ternary Operators. Possible for a one sided action?

Why would you use a ternary operator in this case? The ternary operator is meant to be used when there are two possible scenarios and doesn't make much sense in the case where you only care about the if case. If you have to do it however, simply leave the case empty: (cond)?do_something():;


Short-circuit

isset($foo) and callFunction();

Reverse the condition and omit the second argument

!isset($foo) ?: callFunction();

or return just "something"

isset($foo) ? callFunction() : null;

However, the ternary operators is designed to conditionally fetch a value out of two possible values. You are calling a function, thus it seems you are really looking for if and misuse ?: to save characters?

if (isset($foo)) callFunction();