Should I close database connections after use in PHP?
- by Sprottenwels
I wonder if I should close any unnecessary database connection inside of my PHP scripts.
I am aware of the fact that database connections are closed implicitly when the block stops executing and 'manually' closing the connections could kinda bloat the codebase with unnecessary code.
But shouldn't I do so in order to make by code as readable and as easy understandable as possible, while also preventing several possible issues during run time?
Also, if I would do, would it be enough to unset() my database object?