php - Firebird Interbase Connection - unset() and ibase_close()
Solution:
My knowledge of PHP is rudimentary at best, but as far as I know there is a distinct difference.
The function ibase_close($connection)
will send a message to the database server, so the server releases its connection resources and then it closes the connection, while unset($connection)
will only delete the variable $connection
.
My knowledge of PHP and the firebird-php/interbase driver is not sufficient to know for sure if using unset
will trigger a cleanup or close of the connection, but a quick scan of the firebird-php sources doesn't show any such mechanism. My suggestion is that you should be explicit and use ibase_close
before you call unset
, so you're sure resources (including serverside resources) are released properly.
Answer
Solution:
ibase_close closes the non-persistent connection to the server that's associated with $connection. Default transaction on link is committed, other transactions are rolled back.
unset clears the pointer to the instance.
Source