Why is it not allowed to have a semicolon at the end of a method in a class definition in PHP?

In PHP, a semicolon at the end of a method in a class definition is not allowed because it indicates the end of the method block. Including a semicolon at the end would result in a syntax error as PHP expects the method to have a block of code enclosed in curly braces. To solve this issue, simply remove the semicolon at the end of the method declaration.

class MyClass {
    public function myMethod() {
        // Method code here
    } // No semicolon at the end of the method
}