What are the potential pitfalls of using a single "User" class with a status attribute to differentiate user roles?

Using a single "User" class with a status attribute to differentiate user roles can lead to code complexity and potential security vulnerabilities if not properly managed. It is better to separate different user roles into distinct classes to maintain a clean and organized codebase. This approach also allows for easier maintenance and scalability as the application grows.

class User {
    protected $status;

    public function __construct($status) {
        $this->status = $status;
    }

    public function getStatus() {
        return $this->status;
    }
}

class Admin extends User {
    public function __construct() {
        parent::__construct('admin');
    }
}

class RegularUser extends User {
    public function __construct() {
        parent::__construct('regular');
    }
}