drcp_conn_close2.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics OFF
  3. --EXTENSIONS--
  4. oci8
  5. --INI--
  6. oci8.old_oci_close_semantics=0
  7. oci8.connection_class=test
  8. --FILE--
  9. <?php
  10. require __DIR__."/details.inc";
  11. // Test will open a connection
  12. // Close the connection
  13. // Open another connection
  14. // With oci_close() the connection is released to the pool and hence the
  15. // the second connection will be different
  16. // OCI_CONNECT
  17. echo "This is with a OCI_CONNECT\n";
  18. var_dump($conn1 = oci_connect($user,$password,$dbase));
  19. $rn1 = (int)$conn1;
  20. oci_close($conn1);
  21. // Open another connection
  22. var_dump($conn2 = oci_connect($user,$password,$dbase));
  23. $rn2 = (int)$conn2;
  24. oci_close($conn2);
  25. // Compare the resource numbers
  26. if ($rn1 === $rn2)
  27. echo "Both connections share a resource : NOT OK\n";
  28. else
  29. echo "Both connections are different : OK\n";
  30. echo "Done\n";
  31. ?>
  32. --EXPECTF--
  33. This is with a OCI_CONNECT
  34. resource(%d) of type (oci8 connection)
  35. resource(%d) of type (oci8 connection)
  36. Both connections are different : OK
  37. Done