I have seen advice that says the ternary operator must not be nested.
I have tested the code below and it works okay. My question is, I haven\'t seen the ternary op
You can also do
$res = ($rule1 && !$rule2 && $rule3);