PDOでデータベースへの接続を閉じる

接続、および接続の管理
http://php.net/manual/ja/pdo.connections.php

データベースへの接続に成功すると、PDO クラスのインスタンススクリプトに返されます。この PDO オブジェクトが存在する間、 接続がアクティブであり続けます。接続を閉じるには、他から 参照されていないことを保障することでオブジェクトを破棄する 必要があります。それには、オブジェクトを保持している変数に対して NULL を代入します。 明示的にこれを行わなかった場合は、スクリプトの終了時に自動的に 接続が閉じられます。

インスタンス変数に NULL を代入しろ、ということらしい。



英語版
Connections and Connection management
http://php.net/manual/en/pdo.connections.php

Upon successful connection to the database, an instance of the PDO class is returned to your script. The connection remains active for the lifetime of that PDO object. To close the connection, you need to destroy the object by ensuring that all remaining references to it are deleted—you do this by assigning NULL to the variable that holds the object. If you don't do this explicitly, PHP will automatically close the connection when your script ends.