How can the EVA principle be applied to improve the readability and efficiency of PHP code?

Issue: The EVA principle (Eliminate, Visualize, Automate) can be applied to improve the readability and efficiency of PHP code by removing unnecessary code, organizing the code in a clear and visual manner, and automating repetitive tasks. Code snippet:

// Eliminate unnecessary code
// Before
if ($condition) {
    echo "Condition is true";
} else {
    echo "Condition is false";
}

// After
echo $condition ? "Condition is true" : "Condition is false";

// Visualize the code
// Before
function calculateTotal($price, $quantity) {
    $total = $price * $quantity;
    return $total;
}

// After
function calculateTotal($price, $quantity) {
    return $price * $quantity;
}

// Automate repetitive tasks
// Before
$user = getUserById(1);
$userName = $user['name'];
$userEmail = $user['email'];

// After
$user = getUserById(1);
list($userName, $userEmail) = [$user['name'], $user['email']];