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