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