Здравствуйте! Есть класс Site
class Site
{
public function __construct($mainname = 0, $id = 0, $charset = 0, $email = 0, $login, $index = 0)
{
$this->id = $id;
$this->userid = $login;
$this->mainname = $mainname;
$this->charset = $charset;
$this->email = $email;
$this->index = $index;
}
}
Передаю аргументы:
$site = new Site(1, "admin");
При попытке передать не все аргументы вижу ошибку:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Site::__construct(), 2 passed in E:\xampp\htdocs\dashboard\classes\Site.php on line 48 and at least 5 expected in E:\xampp\htdocs\dashboard\classes\Site.php:6 Stack trace: #0 E:\xampp\htdocs\dashboard\classes\Site.php(48): Site->__construct(1, 'admin') #1 {main} thrown in E:\xampp\htdocs\dashboard\classes\Site.php on line 6