1--TEST--
2explode() function
3--INI--
4error_reporting=2047
5--FILE--
6<?php
7/* From http://bugs.php.net/19865 */
8echo var_export(explode("\1", "a". chr(1). "b". chr(0). "d" . chr(1) . "f" . chr(1). "1" . chr(1) . "d"), TRUE);
9echo md5(var_export(explode("\1", "a". chr(1). "b". chr(0). "d" . chr(1) . "f" . chr(1). "1" . chr(1) . "d"), TRUE));
10echo "\n";
11var_dump(@explode("", ""));
12var_dump(@explode("", NULL));
13var_dump(@explode(NULL, ""));
14var_dump(@explode("a", ""));
15var_dump(@explode("a", "a"));
16var_dump(@explode("a", NULL));
17var_dump(@explode(NULL, a));
18var_dump(@explode("abc", "acb"));
19var_dump(@explode("somestring", "otherstring"));
20var_dump(@explode("somestring", "otherstring", -1));
21var_dump(@explode("a", "aaaaaa"));
22var_dump(@explode("==", str_repeat("-=".ord(0)."=-", 10)));
23var_dump(@explode("=", str_repeat("-=".ord(0)."=-", 10)));
24//////////////////////////////////////
25var_dump(explode(":","a lazy dog:jumps:over:",-1));
26var_dump(explode(":","a lazy dog:jumps:over", -1));
27var_dump(explode(":","a lazy dog:jumps:over", -2));
28var_dump(explode(":","a lazy dog:jumps:over:",-4));
29var_dump(explode(":","a lazy dog:jumps:over:",-40000000000000));
30var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-1));
31var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-2));
32?>
33--EXPECTF--
34array (
35  0 => 'a',
36  1 => 'b' . "\0" . 'd',
37  2 => 'f',
38  3 => '1',
39  4 => 'd',
40)d6bee42a771449205344c0938ad4f035
41bool(false)
42bool(false)
43bool(false)
44array(1) {
45  [0]=>
46  string(0) ""
47}
48array(2) {
49  [0]=>
50  string(0) ""
51  [1]=>
52  string(0) ""
53}
54array(1) {
55  [0]=>
56  string(0) ""
57}
58bool(false)
59array(1) {
60  [0]=>
61  string(3) "acb"
62}
63array(1) {
64  [0]=>
65  string(11) "otherstring"
66}
67array(0) {
68}
69array(7) {
70  [0]=>
71  string(0) ""
72  [1]=>
73  string(0) ""
74  [2]=>
75  string(0) ""
76  [3]=>
77  string(0) ""
78  [4]=>
79  string(0) ""
80  [5]=>
81  string(0) ""
82  [6]=>
83  string(0) ""
84}
85array(1) {
86  [0]=>
87  string(60) "-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-"
88}
89array(21) {
90  [0]=>
91  string(1) "-"
92  [1]=>
93  string(2) "48"
94  [2]=>
95  string(2) "--"
96  [3]=>
97  string(2) "48"
98  [4]=>
99  string(2) "--"
100  [5]=>
101  string(2) "48"
102  [6]=>
103  string(2) "--"
104  [7]=>
105  string(2) "48"
106  [8]=>
107  string(2) "--"
108  [9]=>
109  string(2) "48"
110  [10]=>
111  string(2) "--"
112  [11]=>
113  string(2) "48"
114  [12]=>
115  string(2) "--"
116  [13]=>
117  string(2) "48"
118  [14]=>
119  string(2) "--"
120  [15]=>
121  string(2) "48"
122  [16]=>
123  string(2) "--"
124  [17]=>
125  string(2) "48"
126  [18]=>
127  string(2) "--"
128  [19]=>
129  string(2) "48"
130  [20]=>
131  string(1) "-"
132}
133array(3) {
134  [0]=>
135  string(10) "a lazy dog"
136  [1]=>
137  string(5) "jumps"
138  [2]=>
139  string(4) "over"
140}
141array(2) {
142  [0]=>
143  string(10) "a lazy dog"
144  [1]=>
145  string(5) "jumps"
146}
147array(1) {
148  [0]=>
149  string(10) "a lazy dog"
150}
151array(0) {
152}
153array(0) {
154}
155array(2) {
156  [0]=>
157  string(10) "a lazy dog"
158  [1]=>
159  string(11) "jumps::over"
160}
161array(1) {
162  [0]=>
163  string(10) "a lazy dog"
164}
165