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