|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-06 08:50 UTC] anon at anon dot com
[2006-11-08 10:08 UTC] tony2001@php.net
[2006-11-09 14:55 UTC] david at acz dot org
[2006-12-31 21:01 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 24 15:00:02 2025 UTC |
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