✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
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; }}?>