drcp_newconnect.phpt 860 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --TEST--
  2. DRCP: oci_new_connect()
  3. --EXTENSIONS--
  4. oci8
  5. --INI--
  6. oci8.connection_class=test
  7. oci8.old_oci_close_semantics=0
  8. --FILE--
  9. <?php
  10. require __DIR__."/details.inc";
  11. // Open two connections with oci_new_connect
  12. // Verify they are different by comparing the resource ids
  13. var_dump($c1 = oci_new_connect($user,$password,$dbase));
  14. $rn1 = (int)$c1;
  15. // Another connection now
  16. var_dump($c2 = oci_new_connect($user,$password,$dbase));
  17. $rn2 = (int)$c2;
  18. // rn1 and rn2 should be different.
  19. if ($rn1 === $rn2)
  20. echo "First and second connections share a resource: Not OK\n";
  21. else
  22. echo "First and second connections are different OK\n";
  23. // Close the connections
  24. oci_close($c1);
  25. oci_close($c2);
  26. echo "Done\n";
  27. ?>
  28. --EXPECTF--
  29. resource(%d) of type (oci8 connection)
  30. resource(%d) of type (oci8 connection)
  31. First and second connections are different OK
  32. Done