Q:

OO PHP Constructor is not working?

I'm new to developing objectoriented PHP and trying to create a login-system. Therefore, I made an index file and two classes. It seems to me, that, using var_dump(), the output would contain the elements status, username and more.
But what happens is that i get this notice:
notice: Undefined variable: connector in C:\xampp\htdocs\1-4-LT3\Concept\Authenticator.php on line 15

Fatal error: Call to a member function connect() on a non-object in C:\xampp\htdocs\1-4-LT3\Concept\Authenticator.php on line 15

To me, it seems that the constructors aren't working. 
What am I doing wrong? Why is the  $connector variable undefined?
Oh and I am aware that this way is very unsafe, but I'm just trying to make some sense of OO PHP.
The index.php file:
<?php
include 'Connector.php';
include 'Authenticator.php';
$connector = new Connector('localhost', 'root', '', 'hondsrug_db');
$authenticator = new Authenticator($connector);

$authenticator->login('root', 'admin');
var_dump($authenticator);
?>

The connector.php file:
<?php
class Connector {
    var $mysqli;
    var $host;
    var $username;
    var $password;
    var $database;
    public function Connector($host, $username, $password, $database){
        $this->host = $host;
        $this->username = $username;
        $this->password = $password;
        $this->database = $database;
    }

    public function query($query){
        $result = $mysqli->query($query);
        if($result->num_rows > 0){
            return $result->fetch_assoc;
        } else {
            return null;
        }
    }
    public function connect(){
        $this->mysqli = new mysqli($host, $username, $password, $database);
    }
    public function disconnect(){
        $mysqli->close();
    }

}

?>

and the Authenticator.php file:
<?php
// maakt verbinding met db
// logt in adh van methode
// bepaalt rang, en implementeert hiervoor een getter
class Authenticator {
    var $connector;
    var $status;
    var $username;
    var $rank;
    public function Authenticator($connector){
        $this->connector = $connector;
    }

    public function login($username, $password){
        $connector->connect();
        $result = $connector->query('SELECT password, rank FROM users WHERE username = '.$username);
        if($result != null){
            if($result['password'] == SHA1($password)){
                $this->status = true;
                $this->username = $username;
                $this->rank = $result['rank'];
            } else {
                $this->status = false;
                $this->username = null;
                $this->rank = null;
            }
        } else {
            $status = false;
        }

        $connector->disconnect();
    }

    public function getRank(){
        return $rank;
    }

    public function getStatus(){
        return $status;
    }
}

?>

A:

The issue is here
$connector->connect();

You have used the var $connector inside the class Authenticator and inside the constructor you have 
 $this->connector = $connector;

so while accessing the method you will need to do as
 $this->connector->connect();

Now you are using class name as a function name to make it as constructor, it works though as a backward compatibility , but its better to use magic method __construct and also instead of var you may start using public,private, protected

