xref: /php-src/ext/dba/tests/dba_split.phpt (revision bb2836ec)
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--EXPECTF--
21Deprecated: dba_key_split(): Passing false or null is deprecated since 8.4 in %s on line %d
22bool(false)
23
24Deprecated: dba_key_split(): Passing false or null is deprecated since 8.4 in %s on line %d
25bool(false)
26array(2) {
27  [0]=>
28  string(0) ""
29  [1]=>
30  string(1) "1"
31}
32array(2) {
33  [0]=>
34  string(0) ""
35  [1]=>
36  string(0) ""
37}
38array(2) {
39  [0]=>
40  string(0) ""
41  [1]=>
42  string(5) "name1"
43}
44array(2) {
45  [0]=>
46  string(0) ""
47  [1]=>
48  string(5) "[key1"
49}
50array(2) {
51  [0]=>
52  string(4) "key1"
53  [1]=>
54  string(0) ""
55}
56array(2) {
57  [0]=>
58  string(0) ""
59  [1]=>
60  string(5) "key1]"
61}
62array(2) {
63  [0]=>
64  string(4) "key1"
65  [1]=>
66  string(5) "name1"
67}
68array(2) {
69  [0]=>
70  string(4) "key1"
71  [1]=>
72  string(16) "name1[key2]name2"
73}
74array(2) {
75  [0]=>
76  string(4) "key1"
77  [1]=>
78  string(5) "name1"
79}
80