xref: /PHP-7.2/ext/dba/tests/dba_split.phpt (revision acc80f0f)
1--TEST--
2DBA Split Test
3--SKIPIF--
4<?php
5	require_once dirname(__FILE__) .'/skipif.inc';
6	die("info $HND handler used");
7?>
8--FILE--
9<?php
10var_dump(dba_key_split("key1", "name"));
11var_dump(dba_key_split(1));
12var_dump(dba_key_split(null));
13var_dump(dba_key_split(""));
14var_dump(dba_key_split("name1"));
15var_dump(dba_key_split("[key1"));
16var_dump(dba_key_split("[key1]"));
17var_dump(dba_key_split("key1]"));
18var_dump(dba_key_split("[key1]name1"));
19var_dump(dba_key_split("[key1]name1[key2]name2"));
20var_dump(dba_key_split("[key1]name1"));
21
22?>
23===DONE===
24<?php exit(0); ?>
25--EXPECTF--
26Warning: Wrong parameter count for dba_key_split() in %sdba_split.php on line %d
27NULL
28array(2) {
29  [0]=>
30  string(0) ""
31  [1]=>
32  string(1) "1"
33}
34bool(false)
35array(2) {
36  [0]=>
37  string(0) ""
38  [1]=>
39  string(0) ""
40}
41array(2) {
42  [0]=>
43  string(0) ""
44  [1]=>
45  string(5) "name1"
46}
47array(2) {
48  [0]=>
49  string(0) ""
50  [1]=>
51  string(5) "[key1"
52}
53array(2) {
54  [0]=>
55  string(4) "key1"
56  [1]=>
57  string(0) ""
58}
59array(2) {
60  [0]=>
61  string(0) ""
62  [1]=>
63  string(5) "key1]"
64}
65array(2) {
66  [0]=>
67  string(4) "key1"
68  [1]=>
69  string(5) "name1"
70}
71array(2) {
72  [0]=>
73  string(4) "key1"
74  [1]=>
75  string(16) "name1[key2]name2"
76}
77array(2) {
78  [0]=>
79  string(4) "key1"
80  [1]=>
81  string(5) "name1"
82}
83===DONE===
84