From: Operating system: RHEL 4 R5 PHP version: 5.2.13 Package: OCI8 related Bug Type: Bug Bug description:gargbage collection interferes with oci_connect
Description: ------------ Once your handle gets garbage collected by PHP (falls off the method scope), subsequent calls to oci_connect will generate new connections. This is true in PHP 5.2.13. I wasn't able to verify on PHP 5.3. Test script: --------------- connect(); connect(); $dbh1 = connect(); $dbh2 = connect(); function connect() { $conn_info = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = TEST)))'; $dbh = oci_connect('username', 'password', $conn_info); echo "Our handle is: $dbh<br/>\n"; return $dbh; } function getConnection($sid) Expected result: ---------------- Our handle is: Resource id #35 Our handle is: Resource id #35 Our handle is: Resource id #35 Our handle is: Resource id #35 Actual result: -------------- Our handle is: Resource id #35 Our handle is: Resource id #36 Our handle is: Resource id #37 Our handle is: Resource id #37 -- Edit bug report at http://bugs.php.net/bug.php?id=52056&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52056&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52056&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52056&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52056&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52056&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52056&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52056&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52056&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52056&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52056&r=support Expected behavior: http://bugs.php.net/fix.php?id=52056&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52056&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52056&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52056&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52056&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52056&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52056&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52056&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52056&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52056&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52056&r=mysqlcfg