Mysqli driver raise a lot of warning about Undefined property after connection closed

The problem is in the Mysqli\Connection::Disconnect() that unset property but other methods check it and raise warning. So to fix it just add $this->resource=null; in the end of disconnect method: 

---
    public function disconnect()
    {
        if ($this->resource instanceof \mysqli) {
            $this->resource->close();
        }
        unset($this->resource);
        $this->resource=null; // +++ ADD this string
    }
---