What are the best practices for designing PHP functions to perform a single task?

When designing PHP functions to perform a single task, it is important to follow the principle of "separation of concerns" by ensuring that each function has a clear and specific purpose. This helps to improve code readability, maintainability, and reusability. Additionally, it is recommended to use descriptive function names, pass parameters explicitly rather than relying on global variables, and return values instead of relying on side effects.

// Example of a well-designed PHP function to perform a single task
function calculateAreaOfRectangle($length, $width) {
    $area = $length * $width;
    return $area;
}