ID:               39352
 Updated by:       [EMAIL PROTECTED]
 Reported By:      david at acz dot org
-Status:           Open
+Status:           Assigned
 Bug Type:         OCI8 related
 Operating System: SuSE Linux 9.3
 PHP Version:      5.2.0
-Assigned To:      
+Assigned To:      tony2001


Previous Comments:
------------------------------------------------------------------------

[2006-11-02 22:54:38] david at acz dot org

Description:
------------
oci_close() fails if the connection resource is a global accessed via
the "global" keyword, but works if accessed using the $GLOBALS array.

Reproduce code:
---------------
$conn = oci_connect(DB_USER, DB_PASS, DB_NAME);
var_dump($conn);

global_keyword();
global_array();

function global_keyword()
{
    global $conn;
    var_dump($conn);
    oci_close($conn);  // this seems to do nothing
    var_dump($conn);
}

function global_array()
{
    var_dump($GLOBALS["conn"]);
    oci_close($GLOBALS["conn"]);  // this works
    var_dump($GLOBALS["conn"]);
}


Expected result:
----------------
resource(8) of type (oci8 connection)
resource(8) of type (oci8 connection)
NULL
NULL
PHP Warning: oci_close() expects parameter 1 to be resource, null
given
NULL


Actual result:
--------------
resource(8) of type (oci8 connection)
resource(8) of type (oci8 connection)
resource(8) of type (oci8 connection)
resource(8) of type (oci8 connection)
NULL



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


-- 
Edit this bug report at http://bugs.php.net/?id=39352&edit=1

Reply via email to