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