Skip to content
Advertisement

Firebird Interbase Connection – unset() and ibase_close()

I have a silly question. Is there a difference between unset() and ibase_close() in terms of ending connection to Firebird Database using ibase_connect()? I know that some people use unset() to PDO connections etc.

Like:

JavaScript

And then:

JavaScript

or

JavaScript

If they both are behaving the same, maybe one function is faster than the other one?

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement