How can the EVA principle be applied in PHP code to improve readability and maintainability?

Issue: The EVA principle (Easier to Understand, Valuable to Have, and Affordable to Maintain) can be applied in PHP code by following best practices such as using meaningful variable names, breaking down complex logic into smaller functions, and commenting code effectively. PHP Code Snippet:

// Example of applying the EVA principle in PHP code

// Using meaningful variable names
$firstName = "John";
$lastName = "Doe";

// Breaking down complex logic into smaller functions
function calculateTotal($price, $quantity) {
    return $price * $quantity;
}

$total = calculateTotal(10, 5);

// Commenting code effectively
// This function calculates the total price based on the price and quantity