Q:

why we can use code $this-> in system/library/customer.php

Look at the codes below:
public function __construct($registry) {
        $this->config = $registry->get('config');
        $this->db = $registry->get('db');
        $this->request = $registry->get('request');
        $this->session = $registry->get('session');

My question is the properties $this->config, $this->db, $this->request and $this->session are not defined at this class. And the Customer class neither inherits from another class not implements __get(),__set() method...
Can someone can explain to me why we can use $this-> here?

A:

That is just a variable which will be Declared and assigned value while Object is created, 
try 
class Test{

    function __construct(){
        $this->name = 'Ramesh';
    }
}
print_r(new Test());

