no connection to the database with PHP 8.2 [duplicate]

I have a class that works with PHP 8.0 but not with PHP 8.2

    if(!defined('pageclassconst')) {
        die('You cannot access this file directly!');
    }

    class connectionClass extends mysqli {

        private $host="localhost",$dbname="DB_Name",$dbpass="DB_Pass",$dbuser="DB_User";
        public $con;

        public function __construct() {
            if(!$this->con=$this->connect($this->host, $this->dbuser, $this->dbpass, $this->dbname)) {
                $this->con=$this->set_charset("utf8");
            } else {
                echo "Ein interner Fehler ist aufgetreten!";
                exit;
            }
        }
    }

Where is the error now?
Thanks for help.