What are the consequences of redeclaring a function in PHP and how can it be avoided?

When a function is redeclared in PHP, it can lead to a fatal error as PHP does not allow the redeclaration of functions. To avoid this issue, you can check if the function exists before declaring it using the `function_exists` function.

if (!function_exists('myFunction')) {
    function myFunction() {
        // Function implementation
    }
}