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