quick php question

Discussion in 'OT Technology' started by D1G1T4L, Jun 1, 2007.

  1. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    Code:
        function DbConnector(){
    
            $settings = SystemComponent::getSettings();
    
    
            $host = $settings['dbhost'];
            $db = $settings['dbname'];
            $user = $settings['dbusername'];
            $pass = $settings['dbpassword'];
    
            $this->link = mysql_connect($host, $user, $pass);
            mysql_select_db($db);
            register_shutdown_function(array(&$this, 'close'));
    
        }
    
    
     function close() {
    
            mysql_close($this->link);
    
        }
    
     
    
    
    from what i understand register_shutdown_function will execute close() once the class finishes excuting..... however why wouldnt we just do register_shutdown_function(close) or something.... what does array(&$this, 'close') actually do
     

Share This Page