What are the best practices for organizing class properties and methods in PHP to improve readability and maintainability?

Organizing class properties and methods in PHP is crucial for improving readability and maintainability of the code. One common practice is to group related properties and methods together, either by functionality or visibility (public, protected, private). Additionally, using proper naming conventions and comments can also help in understanding the purpose of each property and method.

class MyClass {
    // Properties
    private $privateProperty;
    protected $protectedProperty;
    public $publicProperty;

    // Constructor
    public function __construct() {
        // Initialize properties
    }

    // Public methods
    public function publicMethod() {
        // Method logic
    }

    // Protected methods
    protected function protectedMethod() {
        // Method logic
    }

    // Private methods
    private function privateMethod() {
        // Method logic
    }
}