php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47867 Oracle connection handler passing by reference to a function does not close
Submitted: 2009-04-01 20:26 UTC Modified: 2009-04-01 21:25 UTC
From: jvillarroel at dazasoftware dot com Assigned: sixd (profile)
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.9 OS: Windows 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jvillarroel at dazasoftware dot com
New email:
PHP Version: OS:

 

 [2009-04-01 20:26 UTC] jvillarroel at dazasoftware dot com
Description:
------------
Oracle connection handler passing by reference to a function does not close.
Php.ini include these extensions:
extension=php_mbstring.dll
extension=php_oci8.dll
Web server is:Apache 2.2.10

Reproduce code:
---------------
function CloseConnection(&$strConnection1)
  {    
    OCILogOff ($strConnection1);
  };

$strConnection = OCILogon("SCOTT", 'TIGER', "SERVICE_NAME");  
  
echo "Before CloseConnection strConexion=".$strConnection."-<br>";
CloseConnection($strConnection);
echo "After CloseConnection strConexion=".$strConnection."-<br>";
die();

Expected result:
----------------
Before CloseConnection strConnection=Resource id #2-
After CloseConnection strConnection=-

Actual result:
--------------
Before CloseConnection strConnection=Resource id #2-
After CloseConnection strConnection=Resource id #2-

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-01 21:25 UTC] sixd@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

------------------------

This is expected due to the reference counting behavior of PHP resources. The underlying connection isn't closed until all references are freed.

There's a related discussion in the section "Close Statement Resources Before Closing Connections" in http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Mar 13 21:01:32 2025 UTC