xref: /PHP-8.1/ext/oci8/tests/coll_002_func.phpt (revision b5a14e6c)
1--TEST--
2oci_new_collection() + free()
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
8require(__DIR__.'/skipif.inc');
9?>
10--FILE--
11<?php
12
13require __DIR__."/connect.inc";
14require __DIR__."/create_type.inc";
15
16var_dump($coll1 = oci_new_collection($c, $type_name));
17
18var_dump(oci_free_collection($coll1));
19
20try {
21    var_dump(oci_collection_size($coll1));
22} catch(\TypeError $exception) {
23    var_dump($exception->getMessage());
24}
25
26echo "Done\n";
27
28require __DIR__."/drop_type.inc";
29
30?>
31--EXPECTF--
32object(OCICollection)#%d (1) {
33  ["collection"]=>
34  resource(%d) of type (oci8 collection)
35}
36bool(true)
37string(%d) "oci_collection_size(): supplied resource is not a valid oci8 collection resource"
38Done
39