xref: /PHP-8.1/ext/oci8/tests/coll_002.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));
17var_dump($coll1->free());
18
19try {
20    var_dump($coll1->size());
21} catch (TypeError $error) {
22    var_dump($error->getMessage());
23}
24
25var_dump(oci_new_collection($c, "NONEXISTENT"));
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) "OCICollection::size(): supplied resource is not a valid oci8 collection resource"
39
40Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d
41bool(false)
42Done
43