What are the differences between PHP4 and PHP5 in terms of defining functions within a class?

In PHP4, functions within a class were defined using the "function" keyword without visibility modifiers like "public" or "private". In PHP5, functions within a class can be defined with visibility modifiers to control access levels. This allows for better encapsulation and code organization in PHP5.

// PHP4 style function definition within a class
class MyClass {
    function myFunction() {
        // function code here
    }
}

// PHP5 style function definition within a class with visibility modifier
class MyClass {
    public function myFunction() {
        // function code here
    }
}