drcp_characterset.phpt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --TEST--
  2. DRCP: oci_pconnect() and oci_connect() with different character sets
  3. --EXTENSIONS--
  4. oci8
  5. --FILE--
  6. <?php
  7. require __DIR__."/details.inc";
  8. // Create connections with oci_connect and oci_pconnect with UTF8 as Charset
  9. $c1 = oci_connect($user,$password,$dbase,"UTF8");
  10. var_dump($c1);
  11. // Now with oci_pconnect()
  12. $p1 = oci_pconnect($user,$password,$dbase,"UTF8");
  13. var_dump($p1);
  14. // Create two more connections with character set US7ASCII
  15. $c2 = oci_connect($user,$password,$dbase,"US7ASCII");
  16. var_dump($c2);
  17. // Now with oci_pconnect()
  18. $p2 = oci_pconnect($user,$password,$dbase,"US7ASCII");
  19. var_dump($p2);
  20. // The two connections c1 and c2 should not share resources as they use different
  21. //character sets
  22. if((int)$c1 === (int)$c2)
  23. echo "First and third connections share a resource: NOT OK\n";
  24. else
  25. echo "First and third connections are different: OK\n";
  26. // The two connections p1 and p2 should not share resources as they use different
  27. //character sets
  28. if((int)$p1 === (int)$p2)
  29. echo "Second and fourth connections share a resource: NOT OK\n";
  30. else
  31. echo "Second and fourth connections are different: OK\n";
  32. // Close all the connections
  33. oci_close($c1);
  34. oci_close($c2);
  35. oci_close($p1);
  36. oci_close($p2);
  37. echo "Done\n";
  38. ?>
  39. --EXPECTF--
  40. resource(%d) of type (oci8 connection)
  41. resource(%d) of type (oci8 persistent connection)
  42. resource(%d) of type (oci8 connection)
  43. resource(%d) of type (oci8 persistent connection)
  44. First and third connections are different: OK
  45. Second and fourth connections are different: OK
  46. Done