Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / ereg / tests / spliti_basic_002.phpt
blobdf61a42cae315dc8aa69c4ee039c21367779fc54
1 --TEST--
2 Test spliti() function : basic functionality - test a number of simple spliti, without specifying a limit
3 --FILE--
4 <?php
5 /* Prototype  : proto array spliti(string pattern, string string [, int limit])
6  * Description: spliti string into array by regular expression 
7  * Source code: ext/standard/reg.c
8  * Alias to functions: 
9  */
12  * Test a number of simple spliti, without specifying a limit
13  */
15 echo "*** Testing ereg() : basic functionality ***\n";
17 include(dirname(__FILE__) . '/regular_expressions.inc');
19 foreach ($expressions as $re) {
20         list($pattern,$string) = $re;
21         echo "\n--> Pattern: '$pattern'; match: '$string'\n";
22         var_dump(spliti($pattern, $string . ' |1| ' . $string . ' |2| ' . $string));
25 echo "Done";
27 --EXPECTF--
28 *** Testing ereg() : basic functionality ***
30 --> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---'
32 Deprecated: Function spliti() is deprecated in %s on line %d
33 array(4) {
34   [0]=>
35   string(2) "--"
36   [1]=>
37   string(9) "-- |1| --"
38   [2]=>
39   string(9) "-- |2| --"
40   [3]=>
41   string(2) "--"
44 --> Pattern: '()'; match: ''
46 Deprecated: Function spliti() is deprecated in %s on line %d
48 Warning: spliti(): Invalid Regular Expression in %s on line %d
49 bool(false)
51 --> Pattern: '()'; match: 'abcdef'
53 Deprecated: Function spliti() is deprecated in %s on line %d
55 Warning: spliti(): Invalid Regular Expression in %s on line %d
56 bool(false)
58 --> Pattern: '[x]|[^x]'; match: 'abcdef'
60 Deprecated: Function spliti() is deprecated in %s on line %d
61 array(29) {
62   [0]=>
63   string(0) ""
64   [1]=>
65   string(0) ""
66   [2]=>
67   string(0) ""
68   [3]=>
69   string(0) ""
70   [4]=>
71   string(0) ""
72   [5]=>
73   string(0) ""
74   [6]=>
75   string(0) ""
76   [7]=>
77   string(0) ""
78   [8]=>
79   string(0) ""
80   [9]=>
81   string(0) ""
82   [10]=>
83   string(0) ""
84   [11]=>
85   string(0) ""
86   [12]=>
87   string(0) ""
88   [13]=>
89   string(0) ""
90   [14]=>
91   string(0) ""
92   [15]=>
93   string(0) ""
94   [16]=>
95   string(0) ""
96   [17]=>
97   string(0) ""
98   [18]=>
99   string(0) ""
100   [19]=>
101   string(0) ""
102   [20]=>
103   string(0) ""
104   [21]=>
105   string(0) ""
106   [22]=>
107   string(0) ""
108   [23]=>
109   string(0) ""
110   [24]=>
111   string(0) ""
112   [25]=>
113   string(0) ""
114   [26]=>
115   string(0) ""
116   [27]=>
117   string(0) ""
118   [28]=>
119   string(0) ""
122 --> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---'
124 Deprecated: Function spliti() is deprecated in %s on line %d
125 array(4) {
126   [0]=>
127   string(4) "--- "
128   [1]=>
129   string(13) " --- |1| --- "
130   [2]=>
131   string(13) " --- |2| --- "
132   [3]=>
133   string(4) " ---"
136 --> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{''
138 Deprecated: Function spliti() is deprecated in %s on line %d
139 array(4) {
140   [0]=>
141   string(0) ""
142   [1]=>
143   string(5) " |1| "
144   [2]=>
145   string(5) " |2| "
146   [3]=>
147   string(0) ""
150 --> Pattern: '\a'; match: 'a'
152 Deprecated: Function spliti() is deprecated in %s on line %d
153 array(4) {
154   [0]=>
155   string(0) ""
156   [1]=>
157   string(5) " |1| "
158   [2]=>
159   string(5) " |2| "
160   [3]=>
161   string(0) ""
164 --> Pattern: '[0-9][^0-9]'; match: '2a'
166 Deprecated: Function spliti() is deprecated in %s on line %d
167 array(6) {
168   [0]=>
169   string(0) ""
170   [1]=>
171   string(2) " |"
172   [2]=>
173   string(1) " "
174   [3]=>
175   string(2) " |"
176   [4]=>
177   string(1) " "
178   [5]=>
179   string(0) ""
182 --> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
184 Deprecated: Function spliti() is deprecated in %s on line %d
185 array(1) {
186   [0]=>
187   string(196) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |1| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |2| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
190 --> Pattern: '^[[:digit:]]{5}'; match: '0123456789'
192 Deprecated: Function spliti() is deprecated in %s on line %d
193 array(3) {
194   [0]=>
195   string(0) ""
196   [1]=>
197   string(0) ""
198   [2]=>
199   string(30) " |1| 0123456789 |2| 0123456789"
202 --> Pattern: '[[:digit:]]{5}$'; match: '0123456789'
204 Deprecated: Function spliti() is deprecated in %s on line %d
205 array(2) {
206   [0]=>
207   string(35) "0123456789 |1| 0123456789 |2| 01234"
208   [1]=>
209   string(0) ""
212 --> Pattern: '[[:blank:]]{1,10}'; match: '
213         '
215 Deprecated: Function spliti() is deprecated in %s on line %d
216 array(6) {
217   [0]=>
218   string(1) "
220   [1]=>
221   string(3) "|1|"
222   [2]=>
223   string(1) "
225   [3]=>
226   string(3) "|2|"
227   [4]=>
228   string(1) "
230   [5]=>
231   string(0) ""
234 --> Pattern: '[[:print:]]{3}'; match: ' a '
236 Deprecated: Function spliti() is deprecated in %s on line %d
237 array(7) {
238   [0]=>
239   string(0) ""
240   [1]=>
241   string(0) ""
242   [2]=>
243   string(0) ""
244   [3]=>
245   string(0) ""
246   [4]=>
247   string(0) ""
248   [5]=>
249   string(0) ""
250   [6]=>
251   string(1) " "
253 Done