How to use Ternary operator logic for single line conditions: (condition)? (if true return value) : (if false return value)

/* Example for basic usage */
$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true