I am trying to assign some value to one array if a condition is true otherwise I want to assign it to another array. I know this is possible with an if statement. However, I am wondering if it can be done with the syntax of a turnery operator?
Using an if statement it would look like this
if(condition){
$foo[] = $value;
} else{
$bar[] = $value;
}
However, my question is if it is possible to write it similar to this?
((condition) ? ($foo[]) : ($bar[])) = $value;