xref: /PHP-8.1/ext/oci8/tests/array_bind_013.phpt (revision 74859783)
1--TEST--
2oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array
3--EXTENSIONS--
4oci8
5--FILE--
6<?php
7
8require __DIR__.'/connect.inc';
9
10$statement = oci_parse($c, 'SELECT user FROM v$session');
11
12$array = array();
13
14try {
15    var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10, SQLT_CHR, -10));
16} catch (ArgumentCountError $exception) {
17    echo $exception->getMessage() . "\n";
18}
19
20var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10));
21var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -1));
22var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, 0));
23
24@oci_execute($statement);
25
26var_dump($array);
27
28echo "Done\n";
29?>
30--EXPECTF--
31oci_bind_array_by_name() expects at most 6 arguments, 7 given
32
33Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
34bool(false)
35
36Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
37bool(false)
38
39Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
40bool(false)
41array(0) {
42}
43Done
44