/** * Clean up the connection when out of scope */ function __destruct() { if ($this->conn !== null) { $this->lb->reuseConnection($this->conn); } }