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