The ternary operator is an operator , therefore, it forms an expression. That way, it will have a value that you can assign to the variable or use as you want. It is used for simple situations when a variable can take two possible values depending on the condition.
For instance: $status = $age > 18 ? 'adult' : 'child';
Although it is possible you should not embed a ternary operator .
if - . , , (true/false). if . if (, ). , if , :
if ($age > 18) {
$status = 'adult';
} else {
$status = 'child';
}