I know PHP closes any open MySQL connection at the end of the script execution, but what happens with connections if a fatal error occurs?
- Do PHP close connections regardless of an error?
- Or are they closed after an amount of time?
- Or is it not opened in that case?
I can't find anything here or on Google.
I use static connections to reuse them. Additionally there is a __destruct()
to close it. On the end of the execution, the destructor is called (I see it in the log-file).
But if I do a fatal error (just to find out what happens), the destructor is NOT called. What happens with the connection?