From: david at acz dot org Operating system: SuSE Linux 9.3 PHP version: 5.2.0 PHP Bug Type: OCI8 related Bug description: oci_close fails with global keyword
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 bug report at http://bugs.php.net/?id=39352&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39352&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39352&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39352&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39352&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39352&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39352&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39352&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39352&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39352&r=support Expected behavior: http://bugs.php.net/fix.php?id=39352&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39352&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39352&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39352&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39352&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39352&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39352&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39352&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39352&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39352&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39352&r=mysqlcfg