File: drcp_conn_close1.phpt

package info (click to toggle)
php5 5.4.45-0%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 140,304 kB
  • sloc: ansic: 725,735; php: 21,197; sh: 11,702; xml: 5,860; cpp: 2,974; exp: 1,514; yacc: 1,271; makefile: 1,228; pascal: 686; awk: 538; perl: 315; sql: 22
file content (45 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--TEST--
DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics ON
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--INI--
oci8.old_oci_close_semantics=1
oci8.connection_class=test
--FILE--
<?php

require dirname(__FILE__)."/details.inc";

// Test will open a connection
// Close the connection
// Open another connection
// With oci_close() being a no-op, the same conneciton will be returned


echo "This is with a OCI_CONNECT\n";
var_dump($conn1 = oci_connect($user,$password,$dbase));
$rn1 = (int)$conn1;
oci_close($conn1);

// Open another connection

var_dump($conn2 = oci_connect($user,$password,$dbase));
$rn2 = (int)$conn2;
oci_close($conn2);

// Compare the resource numbers

if ($rn1 === $rn2)
	echo "Both connections share a resource : OK \n";
else
	echo "Both connections are different : NOT OK \n";

echo "Done\n";

?>
--EXPECTF--
This is with a OCI_CONNECT
resource(%d) of type (oci8 connection)
resource(%d) of type (oci8 connection)
Both connections share a resource : OK 
Done