2 Test spliti() function : usage variations - unexpected type for arg 3
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
11 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
12 if (error_reporting() != 0) {
13 // report non-silenced errors
14 echo "Error: $err_no - $err_msg, $filename($linenum)\n";
17 set_error_handler('test_error_handler');
18 echo "*** Testing spliti() : usage variations ***\n";
20 // Initialise function arguments not being substituted (if any)
21 $pattern = b'[[:space:]]';
22 $string = '1 2 3 4 5';
24 //get an unset variable
28 //array of values to iterate over
42 array('color' => 'red', 'item' => 'pen'),
72 // loop through each element of the array for limit
74 foreach($values as $value) {
75 echo "\nArg value $value \n";
76 var_dump( spliti($pattern, $string, $value) );
82 *** Testing spliti() : usage variations ***
85 Error: 8192 - Function spliti() is deprecated, %s(73)
100 Error: 8192 - Function spliti() is deprecated, %s(73)
103 string(9) "1 2 3 4 5"
106 Arg value 1.07654321E-9
107 Error: 8192 - Function spliti() is deprecated, %s(73)
110 string(9) "1 2 3 4 5"
114 Error: 8192 - Function spliti() is deprecated, %s(73)
117 string(9) "1 2 3 4 5"
119 Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d)
122 Error: 8192 - Function spliti() is deprecated, %s(73)
123 Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73)
125 Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d)
128 Error: 8192 - Function spliti() is deprecated, %s(73)
129 Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73)
131 Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d)
134 Error: 8192 - Function spliti() is deprecated, %s(73)
135 Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73)
137 Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d)
140 Error: 8192 - Function spliti() is deprecated, %s(73)
141 Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73)
143 Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d)
146 Error: 8192 - Function spliti() is deprecated, %s(73)
147 Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73)
151 Error: 8192 - Function spliti() is deprecated, %s(73)
154 string(9) "1 2 3 4 5"
158 Error: 8192 - Function spliti() is deprecated, %s(73)
161 string(9) "1 2 3 4 5"
165 Error: 8192 - Function spliti() is deprecated, %s(73)
168 string(9) "1 2 3 4 5"
172 Error: 8192 - Function spliti() is deprecated, %s(73)
175 string(9) "1 2 3 4 5"
179 Error: 8192 - Function spliti() is deprecated, %s(73)
182 string(9) "1 2 3 4 5"
186 Error: 8192 - Function spliti() is deprecated, %s(73)
189 string(9) "1 2 3 4 5"
193 Error: 8192 - Function spliti() is deprecated, %s(73)
194 Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
198 Error: 8192 - Function spliti() is deprecated, %s(73)
199 Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
203 Error: 8192 - Function spliti() is deprecated, %s(73)
204 Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
208 Error: 8192 - Function spliti() is deprecated, %s(73)
209 Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
211 Error: 4096 - Object of class stdClass could not be converted to string, %s(72)
214 Error: 8192 - Function spliti() is deprecated, %s(73)
215 Error: 2 - spliti() expects parameter 3 to be long, object given, %s(73)
219 Error: 8192 - Function spliti() is deprecated, %s(73)
222 string(9) "1 2 3 4 5"
226 Error: 8192 - Function spliti() is deprecated, %s(73)
229 string(9) "1 2 3 4 5"