✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Gegeben ist folgender PHP Code. Wie kann man außerhalb der Klasse die Methode getAllUsers() aufrufen?
<?phpclass User { private $name; private $email; private static $allUsers = array(); public function __construct($name, $email) { $this->name = $name; $this->email = $email; self::$allUsers[] = $this; } pulbic function getName() { return $this->name; } public function getEmail() { return $this->email; } public static function getAllUsers(){ return self::$allUsers; }}?>