What are best practices for handling function return values in PHP conditional statements?

When handling function return values in PHP conditional statements, it is best practice to assign the return value to a variable and then use that variable in the conditional statement. This makes the code more readable and helps avoid potential issues with calling the function multiple times within the same conditional statement.

// Assign the return value of the function to a variable
$result = myFunction();

// Use the variable in the conditional statement
if ($result === true) {
    // Code to execute if the function returns true
} else {
    // Code to execute if the function does not return true
}