This might sound naive, but in PHP, is it possible modify the outcome of an expression with one boolean value?
for example:
if(expression)
//execute code
now, how can i do this?
if(!expression)
//execute code
with the control of another boolean?
like:
$bool = true;
if( ($bool? :!)expression ) // if($bool) => !expresion ; if(!$bool) => expression
//execute code
so basically i want to have the have !expression
when $bool
is true and expression
when $bool is false
i do know i can :
$bool ? !expression : expression
but it has the same expression twice...