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