ID:               39352
 Updated by:       [EMAIL PROTECTED]
 Reported By:      david at acz dot org
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: SuSE Linux 9.3
 PHP Version:      5.2.0
 New Comment:

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

.


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

[2006-11-09 14:55:54] david at acz dot org

Changing category.

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

[2006-11-08 10:08:45] [EMAIL PROTECTED]

Actually this has nothing to do with OCI8, as this is the way PHP
handles resources.
You can do the same trick with MySQL and it won't actually close the
connection when using global variable, but it will work with $GLOBALS.


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

[2006-11-06 08:50:31] anon at anon dot com

reproduced on Windows 2003 server, using Nov 2 release of 5.2.0

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

[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