ID: 39352 Comment by: anon at anon dot com Reported By: david at acz dot org Status: Assigned Bug Type: OCI8 related Operating System: SuSE Linux 9.3 PHP Version: 5.2.0 Assigned To: tony2001 New Comment:
reproduced on Windows 2003 server, using Nov 2 release of 5.2.0 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