php - Firebird Interbase Connection - unset() and ibase_close()Get the solution ↓↓↓
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.
$connection = ibase_connect(SOME PARAMETERS HERE);
If they both are behaving the same, maybe one function is faster than the other one?
My knowledge of PHP is rudimentary at best, but as far as I know there is a distinct difference.
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
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.
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.
Share solution ↓
Link To Answer People are also looking for solutions of the problem: filter_sanitize_string deprecated
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.