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