Right now, the only way to close a PDO database connection is to destroy the PDO object, which means dropping every reference to it. This RFC from Robert Wolf adds two methods so you can close the connection yourself and check whether it's still open.
How it would work
$pdo = new PDO($dsn); assert($pdo->isConnected()); $pdo->disconnect(); assert(!$pdo->isConnected());
disconnect() closes the connection immediately. isConnected() tells you whether it's still open, and it also notices when the database server has closed the connection from its end.
After you disconnect, anything that needs the database fails with the standard SQLSTATE code 01002, "Disconnect error." It follows your PDO error mode, so you get an exception, a warning, or a false return.
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->disconnect(); // produces PDOException with message "SQLSTATE[01002]: Disconnect error" $pdo->query('SELECT * FROM DB');
A few methods still work after you disconnect: disconnect(), isConnected(), getAttribute(), setAttribute(), errorCode() and errorInfo(). The attribute methods only work with PDO's own attributes, not driver-specific ones.
With persistent connections, creating a new PDO object later opens a fresh connection. However, every PDO object sharing a persistent connection gets disconnected together.
Why you'd want it
The RFC lists a few cases. You might want to free up the database while your application is idle, or deal with databases that time out sessions. You might need to cut the connection quickly after a security incident, or simulate a lost connection in tests.
Today, people often wrap PDO in a class to guarantee only one reference exists. PDO statements also hold a reference to the PDO object, so the wrapper has to track those too, and the RFC calls that burdensome.
What it means for existing code
Nothing should break. The new methods are optional, and destroying the object still closes the connection. You might now see the 01002 error when the server drops the connection, but it behaves like any other PDO error.
Where it stands
It's inactive. The changelog says it was moved there "due to dormancy, failure to engage stewards of PDO." The RFC is dated September 29, 2025, and there's a pull request with the implementation, but no vote.