xref: /PHP-8.0/ext/oci8/tests/array_bind_013.phpt (revision 9975986b)
1--TEST--
2oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array
3--SKIPIF--
4<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
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