title: Does MySQLi require close in destruct function?
body: <p>I am creating a mysqli db object doing the following:</p>
  
  <pre><code>class DatabaseQK {
  public $db;
  public function __construct() {
      $this-&gt;db = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME, true);
  
      // if the connection could not be obtained record an error
      if (mysqli_connect_errno()){
          log_system_error("Fatal DB Error: ", mysqli_connect_error());
          printf("Connect failed: %s\n", mysqli_connect_error());
          exit();
      }
  }
  </code></pre>
  
  <p>Within the destruct function is the following sufficient to close the connection: </p>
  
  <pre><code>public function __destruct() {}
  </code></pre>
  
  <p>or is this needed?</p>
  
  <pre><code>public function __destruct() {
      $this-&gt;db-&gt;close();
  }
  </code></pre>