drcp_conn_close1.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics ON
  3. --EXTENSIONS--
  4. oci8
  5. --INI--
  6. oci8.old_oci_close_semantics=1
  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() being a no-op, the same connection will be returned
  15. echo "This is with a OCI_CONNECT\n";
  16. var_dump($conn1 = oci_connect($user,$password,$dbase));
  17. $rn1 = (int)$conn1;
  18. oci_close($conn1);
  19. // Open another connection
  20. var_dump($conn2 = oci_connect($user,$password,$dbase));
  21. $rn2 = (int)$conn2;
  22. oci_close($conn2);
  23. // Compare the resource numbers
  24. if ($rn1 === $rn2)
  25. echo "Both connections share a resource : OK\n";
  26. else
  27. echo "Both connections are different : NOT OK\n";
  28. echo "Done\n";
  29. ?>
  30. --EXPECTF--
  31. Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s
  32. This is with a OCI_CONNECT
  33. resource(%d) of type (oci8 connection)
  34. resource(%d) of type (oci8 connection)
  35. Both connections share a resource : OK
  36. Done