How can the PHP code snippet be optimized for better performance or readability?

Issue: The PHP code snippet can be optimized for better performance and readability by using more concise syntax and reducing redundancy. Optimization: To optimize the PHP code snippet, we can use the ternary operator to simplify the if-else statements and reduce redundancy. This will make the code more concise and easier to read.

<?php

// Original code snippet
if ($is_logged_in) {
    $status = 'Logged In';
} else {
    $status = 'Not Logged In';
}

// Optimized code snippet
$status = $is_logged_in ? 'Logged In' : 'Not Logged In';

echo $status;

?>