1a541bb80SJani Taskinen--TEST--
2a541bb80SJani TaskinenTest array_merge() function
3a541bb80SJani Taskinen--INI--
4a541bb80SJani Taskinenprecision=14
5a541bb80SJani Taskinen--FILE--
6a541bb80SJani Taskinen<?php
7a541bb80SJani Taskinen/* Prototype: array array_merge(array $array1 [, array $array2 [, array $...]]);
8a541bb80SJani Taskinen   Description: Merge one or more arrays
9a541bb80SJani Taskinen*/
10a541bb80SJani Taskinen
11a541bb80SJani Taskinenecho "\n*** Testing array_merge() basic functionality ***";
12a541bb80SJani Taskinen$begin_array = array(
13a541bb80SJani Taskinen  array(),
14a541bb80SJani Taskinen  array( 1 => "string"),
15a541bb80SJani Taskinen  array( "" => "string"),
16a541bb80SJani Taskinen  array( -2.44444 => 12),
17a541bb80SJani Taskinen  array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL,	"d" => -2.344),
18a541bb80SJani Taskinen  array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL,1 => -2.344),
19782352c5SPeter Kokot  array( NULL, 1.23 => "Hi", "string" => "hello",
20a541bb80SJani Taskinen  array("" => "World", "-2.34" => "a", "0" => "b"))
21a541bb80SJani Taskinen);
22a541bb80SJani Taskinen
23a541bb80SJani Taskinen$end_array   = array(
24a541bb80SJani Taskinen  array(),
25a541bb80SJani Taskinen  array( 1 => "string"),
26a541bb80SJani Taskinen  array( "" => "string"),
27a541bb80SJani Taskinen  array( -2.44444 => 12),
28a541bb80SJani Taskinen  array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL, "d" => -2.344),
29782352c5SPeter Kokot  array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL, 1=> -2.344),
30782352c5SPeter Kokot  array( NULL, 1.23 => "Hi", "string" => "hello",
31a541bb80SJani Taskinen         array("" => "World", "-2.34" => "a", "0" => "b"))
32a541bb80SJani Taskinen);
33a541bb80SJani Taskinen
34a541bb80SJani Taskinen/* loop through to merge two arrays */
35a541bb80SJani Taskinen$count_outer = 0;
36a541bb80SJani Taskinenforeach($begin_array as $first) {
37a541bb80SJani Taskinen  echo "\n\n--- Iteration $count_outer ---";
38a541bb80SJani Taskinen  $count_inner = 0;
39a541bb80SJani Taskinen  foreach($end_array as $second) {
40a541bb80SJani Taskinen    echo "\n-- Inner iteration $count_inner of Iteration $count_outer --\n";
41a541bb80SJani Taskinen    $result = array_merge($first, $second);
42a541bb80SJani Taskinen    print_r($result);
43a541bb80SJani Taskinen    $count_inner++;
44782352c5SPeter Kokot  }
45a541bb80SJani Taskinen  $count_outer++;
46a541bb80SJani Taskinen}
47a541bb80SJani Taskinen
48a541bb80SJani Taskinen
49a541bb80SJani Taskinenecho "\n*** Testing array_merge() with three or more arrays ***\n";
50782352c5SPeter Kokotvar_dump( array_merge( $end_array[0],
51782352c5SPeter Kokot                       $end_array[5],
52a541bb80SJani Taskinen                       $end_array[4],
53a541bb80SJani Taskinen                       $end_array[6]
54a541bb80SJani Taskinen                     )
55a541bb80SJani Taskinen        );
56a541bb80SJani Taskinen
57782352c5SPeter Kokotvar_dump( array_merge( $end_array[0],
58782352c5SPeter Kokot                       $end_array[5],
59782352c5SPeter Kokot                       array("array on fly"),
60a541bb80SJani Taskinen                       array("nullarray" => array())
61a541bb80SJani Taskinen                     )
62a541bb80SJani Taskinen        );
63a541bb80SJani Taskinen
64a541bb80SJani Taskinen
65a541bb80SJani Taskinenecho "\n*** Testing single array argument ***\n";
66a541bb80SJani Taskinen/* Empty array */
67782352c5SPeter Kokotvar_dump(array_merge(array()));
68a541bb80SJani Taskinen
69a541bb80SJani Taskinen/* associative array with string keys, which will not be re-indexed */
70a541bb80SJani Taskinenvar_dump(array_merge($begin_array[4]));
71a541bb80SJani Taskinen
72a541bb80SJani Taskinen/* associative array with numeric keys, which will be re-indexed */
73a541bb80SJani Taskinenvar_dump(array_merge($begin_array[5]));
74a541bb80SJani Taskinen
75a541bb80SJani Taskinen/* associative array with mixed keys and sub-array as element */
76a541bb80SJani Taskinenvar_dump(array_merge($begin_array[6]));
77a541bb80SJani Taskinen
78a541bb80SJani Taskinenecho "\n*** Testing array_merge() with typecasting non-array to array ***\n";
79a541bb80SJani Taskinenvar_dump(array_merge($begin_array[4], (array)"type1", (array)10, (array)12.34));
80a541bb80SJani Taskinen
81a541bb80SJani Taskinenecho "\n*** Testing error conditions ***";
8204145dc2SVeres Lajos/* Invalid arguments */
83a541bb80SJani Taskinenvar_dump(array_merge());
84a541bb80SJani Taskinenvar_dump(array_merge(100, 200));
85a541bb80SJani Taskinenvar_dump(array_merge($begin_array[0], $begin_array[1], 100));
86a541bb80SJani Taskinenvar_dump(array_merge($begin_array[0], $begin_array[1], $arr4));
87a541bb80SJani Taskinen
88a541bb80SJani Taskinenecho "Done\n";
89782352c5SPeter Kokot?>
90a541bb80SJani Taskinen--EXPECTF--
91a541bb80SJani Taskinen*** Testing array_merge() basic functionality ***
92a541bb80SJani Taskinen
93a541bb80SJani Taskinen--- Iteration 0 ---
94a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 0 --
95a541bb80SJani TaskinenArray
96a541bb80SJani Taskinen(
97a541bb80SJani Taskinen)
98a541bb80SJani Taskinen
99a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 0 --
100a541bb80SJani TaskinenArray
101a541bb80SJani Taskinen(
102a541bb80SJani Taskinen    [0] => string
103a541bb80SJani Taskinen)
104a541bb80SJani Taskinen
105a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 0 --
106a541bb80SJani TaskinenArray
107a541bb80SJani Taskinen(
108a541bb80SJani Taskinen    [] => string
109a541bb80SJani Taskinen)
110a541bb80SJani Taskinen
111a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 0 --
112a541bb80SJani TaskinenArray
113a541bb80SJani Taskinen(
114a541bb80SJani Taskinen    [0] => 12
115a541bb80SJani Taskinen)
116a541bb80SJani Taskinen
117a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 0 --
118a541bb80SJani TaskinenArray
119a541bb80SJani Taskinen(
120a541bb80SJani Taskinen    [a] => 1
121a541bb80SJani Taskinen    [b] => string
122a541bb80SJani Taskinen    [c] => 
123a541bb80SJani Taskinen    [d] => -2.344
124a541bb80SJani Taskinen)
125a541bb80SJani Taskinen
126a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 0 --
127a541bb80SJani TaskinenArray
128a541bb80SJani Taskinen(
129a541bb80SJani Taskinen    [0] => 1
130a541bb80SJani Taskinen    [1] => string
131a541bb80SJani Taskinen    [2] => 
132a541bb80SJani Taskinen    [3] => -2.344
133a541bb80SJani Taskinen)
134a541bb80SJani Taskinen
135a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 0 --
136a541bb80SJani TaskinenArray
137a541bb80SJani Taskinen(
138a541bb80SJani Taskinen    [0] => 
139a541bb80SJani Taskinen    [1] => Hi
140a541bb80SJani Taskinen    [string] => hello
141a541bb80SJani Taskinen    [2] => Array
142a541bb80SJani Taskinen        (
143a541bb80SJani Taskinen            [] => World
144a541bb80SJani Taskinen            [-2.34] => a
145a541bb80SJani Taskinen            [0] => b
146a541bb80SJani Taskinen        )
147a541bb80SJani Taskinen
148a541bb80SJani Taskinen)
149a541bb80SJani Taskinen
150a541bb80SJani Taskinen
151a541bb80SJani Taskinen--- Iteration 1 ---
152a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 1 --
153a541bb80SJani TaskinenArray
154a541bb80SJani Taskinen(
155a541bb80SJani Taskinen    [0] => string
156a541bb80SJani Taskinen)
157a541bb80SJani Taskinen
158a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 1 --
159a541bb80SJani TaskinenArray
160a541bb80SJani Taskinen(
161a541bb80SJani Taskinen    [0] => string
162a541bb80SJani Taskinen    [1] => string
163a541bb80SJani Taskinen)
164a541bb80SJani Taskinen
165a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 1 --
166a541bb80SJani TaskinenArray
167a541bb80SJani Taskinen(
168a541bb80SJani Taskinen    [0] => string
169a541bb80SJani Taskinen    [] => string
170a541bb80SJani Taskinen)
171a541bb80SJani Taskinen
172a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 1 --
173a541bb80SJani TaskinenArray
174a541bb80SJani Taskinen(
175a541bb80SJani Taskinen    [0] => string
176a541bb80SJani Taskinen    [1] => 12
177a541bb80SJani Taskinen)
178a541bb80SJani Taskinen
179a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 1 --
180a541bb80SJani TaskinenArray
181a541bb80SJani Taskinen(
182a541bb80SJani Taskinen    [0] => string
183a541bb80SJani Taskinen    [a] => 1
184a541bb80SJani Taskinen    [b] => string
185a541bb80SJani Taskinen    [c] => 
186a541bb80SJani Taskinen    [d] => -2.344
187a541bb80SJani Taskinen)
188a541bb80SJani Taskinen
189a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 1 --
190a541bb80SJani TaskinenArray
191a541bb80SJani Taskinen(
192a541bb80SJani Taskinen    [0] => string
193a541bb80SJani Taskinen    [1] => 1
194a541bb80SJani Taskinen    [2] => string
195a541bb80SJani Taskinen    [3] => 
196a541bb80SJani Taskinen    [4] => -2.344
197a541bb80SJani Taskinen)
198a541bb80SJani Taskinen
199a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 1 --
200a541bb80SJani TaskinenArray
201a541bb80SJani Taskinen(
202a541bb80SJani Taskinen    [0] => string
203a541bb80SJani Taskinen    [1] => 
204a541bb80SJani Taskinen    [2] => Hi
205a541bb80SJani Taskinen    [string] => hello
206a541bb80SJani Taskinen    [3] => Array
207a541bb80SJani Taskinen        (
208a541bb80SJani Taskinen            [] => World
209a541bb80SJani Taskinen            [-2.34] => a
210a541bb80SJani Taskinen            [0] => b
211a541bb80SJani Taskinen        )
212a541bb80SJani Taskinen
213a541bb80SJani Taskinen)
214a541bb80SJani Taskinen
215a541bb80SJani Taskinen
216a541bb80SJani Taskinen--- Iteration 2 ---
217a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 2 --
218a541bb80SJani TaskinenArray
219a541bb80SJani Taskinen(
220a541bb80SJani Taskinen    [] => string
221a541bb80SJani Taskinen)
222a541bb80SJani Taskinen
223a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 2 --
224a541bb80SJani TaskinenArray
225a541bb80SJani Taskinen(
226a541bb80SJani Taskinen    [] => string
227a541bb80SJani Taskinen    [0] => string
228a541bb80SJani Taskinen)
229a541bb80SJani Taskinen
230a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 2 --
231a541bb80SJani TaskinenArray
232a541bb80SJani Taskinen(
233a541bb80SJani Taskinen    [] => string
234a541bb80SJani Taskinen)
235a541bb80SJani Taskinen
236a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 2 --
237a541bb80SJani TaskinenArray
238a541bb80SJani Taskinen(
239a541bb80SJani Taskinen    [] => string
240a541bb80SJani Taskinen    [0] => 12
241a541bb80SJani Taskinen)
242a541bb80SJani Taskinen
243a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 2 --
244a541bb80SJani TaskinenArray
245a541bb80SJani Taskinen(
246a541bb80SJani Taskinen    [] => string
247a541bb80SJani Taskinen    [a] => 1
248a541bb80SJani Taskinen    [b] => string
249a541bb80SJani Taskinen    [c] => 
250a541bb80SJani Taskinen    [d] => -2.344
251a541bb80SJani Taskinen)
252a541bb80SJani Taskinen
253a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 2 --
254a541bb80SJani TaskinenArray
255a541bb80SJani Taskinen(
256a541bb80SJani Taskinen    [] => string
257a541bb80SJani Taskinen    [0] => 1
258a541bb80SJani Taskinen    [1] => string
259a541bb80SJani Taskinen    [2] => 
260a541bb80SJani Taskinen    [3] => -2.344
261a541bb80SJani Taskinen)
262a541bb80SJani Taskinen
263a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 2 --
264a541bb80SJani TaskinenArray
265a541bb80SJani Taskinen(
266a541bb80SJani Taskinen    [] => string
267a541bb80SJani Taskinen    [0] => 
268a541bb80SJani Taskinen    [1] => Hi
269a541bb80SJani Taskinen    [string] => hello
270a541bb80SJani Taskinen    [2] => Array
271a541bb80SJani Taskinen        (
272a541bb80SJani Taskinen            [] => World
273a541bb80SJani Taskinen            [-2.34] => a
274a541bb80SJani Taskinen            [0] => b
275a541bb80SJani Taskinen        )
276a541bb80SJani Taskinen
277a541bb80SJani Taskinen)
278a541bb80SJani Taskinen
279a541bb80SJani Taskinen
280a541bb80SJani Taskinen--- Iteration 3 ---
281a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 3 --
282a541bb80SJani TaskinenArray
283a541bb80SJani Taskinen(
284a541bb80SJani Taskinen    [0] => 12
285a541bb80SJani Taskinen)
286a541bb80SJani Taskinen
287a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 3 --
288a541bb80SJani TaskinenArray
289a541bb80SJani Taskinen(
290a541bb80SJani Taskinen    [0] => 12
291a541bb80SJani Taskinen    [1] => string
292a541bb80SJani Taskinen)
293a541bb80SJani Taskinen
294a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 3 --
295a541bb80SJani TaskinenArray
296a541bb80SJani Taskinen(
297a541bb80SJani Taskinen    [0] => 12
298a541bb80SJani Taskinen    [] => string
299a541bb80SJani Taskinen)
300a541bb80SJani Taskinen
301a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 3 --
302a541bb80SJani TaskinenArray
303a541bb80SJani Taskinen(
304a541bb80SJani Taskinen    [0] => 12
305a541bb80SJani Taskinen    [1] => 12
306a541bb80SJani Taskinen)
307a541bb80SJani Taskinen
308a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 3 --
309a541bb80SJani TaskinenArray
310a541bb80SJani Taskinen(
311a541bb80SJani Taskinen    [0] => 12
312a541bb80SJani Taskinen    [a] => 1
313a541bb80SJani Taskinen    [b] => string
314a541bb80SJani Taskinen    [c] => 
315a541bb80SJani Taskinen    [d] => -2.344
316a541bb80SJani Taskinen)
317a541bb80SJani Taskinen
318a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 3 --
319a541bb80SJani TaskinenArray
320a541bb80SJani Taskinen(
321a541bb80SJani Taskinen    [0] => 12
322a541bb80SJani Taskinen    [1] => 1
323a541bb80SJani Taskinen    [2] => string
324a541bb80SJani Taskinen    [3] => 
325a541bb80SJani Taskinen    [4] => -2.344
326a541bb80SJani Taskinen)
327a541bb80SJani Taskinen
328a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 3 --
329a541bb80SJani TaskinenArray
330a541bb80SJani Taskinen(
331a541bb80SJani Taskinen    [0] => 12
332a541bb80SJani Taskinen    [1] => 
333a541bb80SJani Taskinen    [2] => Hi
334a541bb80SJani Taskinen    [string] => hello
335a541bb80SJani Taskinen    [3] => Array
336a541bb80SJani Taskinen        (
337a541bb80SJani Taskinen            [] => World
338a541bb80SJani Taskinen            [-2.34] => a
339a541bb80SJani Taskinen            [0] => b
340a541bb80SJani Taskinen        )
341a541bb80SJani Taskinen
342a541bb80SJani Taskinen)
343a541bb80SJani Taskinen
344a541bb80SJani Taskinen
345a541bb80SJani Taskinen--- Iteration 4 ---
346a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 4 --
347a541bb80SJani TaskinenArray
348a541bb80SJani Taskinen(
349a541bb80SJani Taskinen    [a] => 1
350a541bb80SJani Taskinen    [b] => string
351a541bb80SJani Taskinen    [c] => 
352a541bb80SJani Taskinen    [d] => -2.344
353a541bb80SJani Taskinen)
354a541bb80SJani Taskinen
355a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 4 --
356a541bb80SJani TaskinenArray
357a541bb80SJani Taskinen(
358a541bb80SJani Taskinen    [a] => 1
359a541bb80SJani Taskinen    [b] => string
360a541bb80SJani Taskinen    [c] => 
361a541bb80SJani Taskinen    [d] => -2.344
362a541bb80SJani Taskinen    [0] => string
363a541bb80SJani Taskinen)
364a541bb80SJani Taskinen
365a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 4 --
366a541bb80SJani TaskinenArray
367a541bb80SJani Taskinen(
368a541bb80SJani Taskinen    [a] => 1
369a541bb80SJani Taskinen    [b] => string
370a541bb80SJani Taskinen    [c] => 
371a541bb80SJani Taskinen    [d] => -2.344
372a541bb80SJani Taskinen    [] => string
373a541bb80SJani Taskinen)
374a541bb80SJani Taskinen
375a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 4 --
376a541bb80SJani TaskinenArray
377a541bb80SJani Taskinen(
378a541bb80SJani Taskinen    [a] => 1
379a541bb80SJani Taskinen    [b] => string
380a541bb80SJani Taskinen    [c] => 
381a541bb80SJani Taskinen    [d] => -2.344
382a541bb80SJani Taskinen    [0] => 12
383a541bb80SJani Taskinen)
384a541bb80SJani Taskinen
385a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 4 --
386a541bb80SJani TaskinenArray
387a541bb80SJani Taskinen(
388a541bb80SJani Taskinen    [a] => 1
389a541bb80SJani Taskinen    [b] => string
390a541bb80SJani Taskinen    [c] => 
391a541bb80SJani Taskinen    [d] => -2.344
392a541bb80SJani Taskinen)
393a541bb80SJani Taskinen
394a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 4 --
395a541bb80SJani TaskinenArray
396a541bb80SJani Taskinen(
397a541bb80SJani Taskinen    [a] => 1
398a541bb80SJani Taskinen    [b] => string
399a541bb80SJani Taskinen    [c] => 
400a541bb80SJani Taskinen    [d] => -2.344
401a541bb80SJani Taskinen    [0] => 1
402a541bb80SJani Taskinen    [1] => string
403a541bb80SJani Taskinen    [2] => 
404a541bb80SJani Taskinen    [3] => -2.344
405a541bb80SJani Taskinen)
406a541bb80SJani Taskinen
407a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 4 --
408a541bb80SJani TaskinenArray
409a541bb80SJani Taskinen(
410a541bb80SJani Taskinen    [a] => 1
411a541bb80SJani Taskinen    [b] => string
412a541bb80SJani Taskinen    [c] => 
413a541bb80SJani Taskinen    [d] => -2.344
414a541bb80SJani Taskinen    [0] => 
415a541bb80SJani Taskinen    [1] => Hi
416a541bb80SJani Taskinen    [string] => hello
417a541bb80SJani Taskinen    [2] => Array
418a541bb80SJani Taskinen        (
419a541bb80SJani Taskinen            [] => World
420a541bb80SJani Taskinen            [-2.34] => a
421a541bb80SJani Taskinen            [0] => b
422a541bb80SJani Taskinen        )
423a541bb80SJani Taskinen
424a541bb80SJani Taskinen)
425a541bb80SJani Taskinen
426a541bb80SJani Taskinen
427a541bb80SJani Taskinen--- Iteration 5 ---
428a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 5 --
429a541bb80SJani TaskinenArray
430a541bb80SJani Taskinen(
431a541bb80SJani Taskinen    [0] => 1
432a541bb80SJani Taskinen    [1] => string
433a541bb80SJani Taskinen    [2] => 
434a541bb80SJani Taskinen    [3] => -2.344
435a541bb80SJani Taskinen)
436a541bb80SJani Taskinen
437a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 5 --
438a541bb80SJani TaskinenArray
439a541bb80SJani Taskinen(
440a541bb80SJani Taskinen    [0] => 1
441a541bb80SJani Taskinen    [1] => string
442a541bb80SJani Taskinen    [2] => 
443a541bb80SJani Taskinen    [3] => -2.344
444a541bb80SJani Taskinen    [4] => string
445a541bb80SJani Taskinen)
446a541bb80SJani Taskinen
447a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 5 --
448a541bb80SJani TaskinenArray
449a541bb80SJani Taskinen(
450a541bb80SJani Taskinen    [0] => 1
451a541bb80SJani Taskinen    [1] => string
452a541bb80SJani Taskinen    [2] => 
453a541bb80SJani Taskinen    [3] => -2.344
454a541bb80SJani Taskinen    [] => string
455a541bb80SJani Taskinen)
456a541bb80SJani Taskinen
457a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 5 --
458a541bb80SJani TaskinenArray
459a541bb80SJani Taskinen(
460a541bb80SJani Taskinen    [0] => 1
461a541bb80SJani Taskinen    [1] => string
462a541bb80SJani Taskinen    [2] => 
463a541bb80SJani Taskinen    [3] => -2.344
464a541bb80SJani Taskinen    [4] => 12
465a541bb80SJani Taskinen)
466a541bb80SJani Taskinen
467a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 5 --
468a541bb80SJani TaskinenArray
469a541bb80SJani Taskinen(
470a541bb80SJani Taskinen    [0] => 1
471a541bb80SJani Taskinen    [1] => string
472a541bb80SJani Taskinen    [2] => 
473a541bb80SJani Taskinen    [3] => -2.344
474a541bb80SJani Taskinen    [a] => 1
475a541bb80SJani Taskinen    [b] => string
476a541bb80SJani Taskinen    [c] => 
477a541bb80SJani Taskinen    [d] => -2.344
478a541bb80SJani Taskinen)
479a541bb80SJani Taskinen
480a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 5 --
481a541bb80SJani TaskinenArray
482a541bb80SJani Taskinen(
483a541bb80SJani Taskinen    [0] => 1
484a541bb80SJani Taskinen    [1] => string
485a541bb80SJani Taskinen    [2] => 
486a541bb80SJani Taskinen    [3] => -2.344
487a541bb80SJani Taskinen    [4] => 1
488a541bb80SJani Taskinen    [5] => string
489a541bb80SJani Taskinen    [6] => 
490a541bb80SJani Taskinen    [7] => -2.344
491a541bb80SJani Taskinen)
492a541bb80SJani Taskinen
493a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 5 --
494a541bb80SJani TaskinenArray
495a541bb80SJani Taskinen(
496a541bb80SJani Taskinen    [0] => 1
497a541bb80SJani Taskinen    [1] => string
498a541bb80SJani Taskinen    [2] => 
499a541bb80SJani Taskinen    [3] => -2.344
500a541bb80SJani Taskinen    [4] => 
501a541bb80SJani Taskinen    [5] => Hi
502a541bb80SJani Taskinen    [string] => hello
503a541bb80SJani Taskinen    [6] => Array
504a541bb80SJani Taskinen        (
505a541bb80SJani Taskinen            [] => World
506a541bb80SJani Taskinen            [-2.34] => a
507a541bb80SJani Taskinen            [0] => b
508a541bb80SJani Taskinen        )
509a541bb80SJani Taskinen
510a541bb80SJani Taskinen)
511a541bb80SJani Taskinen
512a541bb80SJani Taskinen
513a541bb80SJani Taskinen--- Iteration 6 ---
514a541bb80SJani Taskinen-- Inner iteration 0 of Iteration 6 --
515a541bb80SJani TaskinenArray
516a541bb80SJani Taskinen(
517a541bb80SJani Taskinen    [0] => 
518a541bb80SJani Taskinen    [1] => Hi
519a541bb80SJani Taskinen    [string] => hello
520a541bb80SJani Taskinen    [2] => Array
521a541bb80SJani Taskinen        (
522a541bb80SJani Taskinen            [] => World
523a541bb80SJani Taskinen            [-2.34] => a
524a541bb80SJani Taskinen            [0] => b
525a541bb80SJani Taskinen        )
526a541bb80SJani Taskinen
527a541bb80SJani Taskinen)
528a541bb80SJani Taskinen
529a541bb80SJani Taskinen-- Inner iteration 1 of Iteration 6 --
530a541bb80SJani TaskinenArray
531a541bb80SJani Taskinen(
532a541bb80SJani Taskinen    [0] => 
533a541bb80SJani Taskinen    [1] => Hi
534a541bb80SJani Taskinen    [string] => hello
535a541bb80SJani Taskinen    [2] => Array
536a541bb80SJani Taskinen        (
537a541bb80SJani Taskinen            [] => World
538a541bb80SJani Taskinen            [-2.34] => a
539a541bb80SJani Taskinen            [0] => b
540a541bb80SJani Taskinen        )
541a541bb80SJani Taskinen
542a541bb80SJani Taskinen    [3] => string
543a541bb80SJani Taskinen)
544a541bb80SJani Taskinen
545a541bb80SJani Taskinen-- Inner iteration 2 of Iteration 6 --
546a541bb80SJani TaskinenArray
547a541bb80SJani Taskinen(
548a541bb80SJani Taskinen    [0] => 
549a541bb80SJani Taskinen    [1] => Hi
550a541bb80SJani Taskinen    [string] => hello
551a541bb80SJani Taskinen    [2] => Array
552a541bb80SJani Taskinen        (
553a541bb80SJani Taskinen            [] => World
554a541bb80SJani Taskinen            [-2.34] => a
555a541bb80SJani Taskinen            [0] => b
556a541bb80SJani Taskinen        )
557a541bb80SJani Taskinen
558a541bb80SJani Taskinen    [] => string
559a541bb80SJani Taskinen)
560a541bb80SJani Taskinen
561a541bb80SJani Taskinen-- Inner iteration 3 of Iteration 6 --
562a541bb80SJani TaskinenArray
563a541bb80SJani Taskinen(
564a541bb80SJani Taskinen    [0] => 
565a541bb80SJani Taskinen    [1] => Hi
566a541bb80SJani Taskinen    [string] => hello
567a541bb80SJani Taskinen    [2] => Array
568a541bb80SJani Taskinen        (
569a541bb80SJani Taskinen            [] => World
570a541bb80SJani Taskinen            [-2.34] => a
571a541bb80SJani Taskinen            [0] => b
572a541bb80SJani Taskinen        )
573a541bb80SJani Taskinen
574a541bb80SJani Taskinen    [3] => 12
575a541bb80SJani Taskinen)
576a541bb80SJani Taskinen
577a541bb80SJani Taskinen-- Inner iteration 4 of Iteration 6 --
578a541bb80SJani TaskinenArray
579a541bb80SJani Taskinen(
580a541bb80SJani Taskinen    [0] => 
581a541bb80SJani Taskinen    [1] => Hi
582a541bb80SJani Taskinen    [string] => hello
583a541bb80SJani Taskinen    [2] => Array
584a541bb80SJani Taskinen        (
585a541bb80SJani Taskinen            [] => World
586a541bb80SJani Taskinen            [-2.34] => a
587a541bb80SJani Taskinen            [0] => b
588a541bb80SJani Taskinen        )
589a541bb80SJani Taskinen
590a541bb80SJani Taskinen    [a] => 1
591a541bb80SJani Taskinen    [b] => string
592a541bb80SJani Taskinen    [c] => 
593a541bb80SJani Taskinen    [d] => -2.344
594a541bb80SJani Taskinen)
595a541bb80SJani Taskinen
596a541bb80SJani Taskinen-- Inner iteration 5 of Iteration 6 --
597a541bb80SJani TaskinenArray
598a541bb80SJani Taskinen(
599a541bb80SJani Taskinen    [0] => 
600a541bb80SJani Taskinen    [1] => Hi
601a541bb80SJani Taskinen    [string] => hello
602a541bb80SJani Taskinen    [2] => Array
603a541bb80SJani Taskinen        (
604a541bb80SJani Taskinen            [] => World
605a541bb80SJani Taskinen            [-2.34] => a
606a541bb80SJani Taskinen            [0] => b
607a541bb80SJani Taskinen        )
608a541bb80SJani Taskinen
609a541bb80SJani Taskinen    [3] => 1
610a541bb80SJani Taskinen    [4] => string
611a541bb80SJani Taskinen    [5] => 
612a541bb80SJani Taskinen    [6] => -2.344
613a541bb80SJani Taskinen)
614a541bb80SJani Taskinen
615a541bb80SJani Taskinen-- Inner iteration 6 of Iteration 6 --
616a541bb80SJani TaskinenArray
617a541bb80SJani Taskinen(
618a541bb80SJani Taskinen    [0] => 
619a541bb80SJani Taskinen    [1] => Hi
620a541bb80SJani Taskinen    [string] => hello
621a541bb80SJani Taskinen    [2] => Array
622a541bb80SJani Taskinen        (
623a541bb80SJani Taskinen            [] => World
624a541bb80SJani Taskinen            [-2.34] => a
625a541bb80SJani Taskinen            [0] => b
626a541bb80SJani Taskinen        )
627a541bb80SJani Taskinen
628a541bb80SJani Taskinen    [3] => 
629a541bb80SJani Taskinen    [4] => Hi
630a541bb80SJani Taskinen    [5] => Array
631a541bb80SJani Taskinen        (
632a541bb80SJani Taskinen            [] => World
633a541bb80SJani Taskinen            [-2.34] => a
634a541bb80SJani Taskinen            [0] => b
635a541bb80SJani Taskinen        )
636a541bb80SJani Taskinen
637a541bb80SJani Taskinen)
638a541bb80SJani Taskinen
639a541bb80SJani Taskinen*** Testing array_merge() with three or more arrays ***
640a541bb80SJani Taskinenarray(12) {
641a541bb80SJani Taskinen  [0]=>
642a541bb80SJani Taskinen  int(1)
643a541bb80SJani Taskinen  [1]=>
644a541bb80SJani Taskinen  string(6) "string"
645a541bb80SJani Taskinen  [2]=>
646a541bb80SJani Taskinen  NULL
647a541bb80SJani Taskinen  [3]=>
648a541bb80SJani Taskinen  float(-2.344)
649a541bb80SJani Taskinen  ["a"]=>
650a541bb80SJani Taskinen  int(1)
651a541bb80SJani Taskinen  ["b"]=>
652a541bb80SJani Taskinen  string(6) "string"
653a541bb80SJani Taskinen  ["c"]=>
654a541bb80SJani Taskinen  NULL
655a541bb80SJani Taskinen  ["d"]=>
656a541bb80SJani Taskinen  float(-2.344)
657a541bb80SJani Taskinen  [4]=>
658a541bb80SJani Taskinen  NULL
659a541bb80SJani Taskinen  [5]=>
660a541bb80SJani Taskinen  string(2) "Hi"
661a541bb80SJani Taskinen  ["string"]=>
662a541bb80SJani Taskinen  string(5) "hello"
663a541bb80SJani Taskinen  [6]=>
664a541bb80SJani Taskinen  array(3) {
665a541bb80SJani Taskinen    [""]=>
666a541bb80SJani Taskinen    string(5) "World"
667a541bb80SJani Taskinen    ["-2.34"]=>
668a541bb80SJani Taskinen    string(1) "a"
669a541bb80SJani Taskinen    [0]=>
670a541bb80SJani Taskinen    string(1) "b"
671a541bb80SJani Taskinen  }
672a541bb80SJani Taskinen}
673a541bb80SJani Taskinenarray(6) {
674a541bb80SJani Taskinen  [0]=>
675a541bb80SJani Taskinen  int(1)
676a541bb80SJani Taskinen  [1]=>
677a541bb80SJani Taskinen  string(6) "string"
678a541bb80SJani Taskinen  [2]=>
679a541bb80SJani Taskinen  NULL
680a541bb80SJani Taskinen  [3]=>
681a541bb80SJani Taskinen  float(-2.344)
682a541bb80SJani Taskinen  [4]=>
683a541bb80SJani Taskinen  string(12) "array on fly"
684a541bb80SJani Taskinen  ["nullarray"]=>
685a541bb80SJani Taskinen  array(0) {
686a541bb80SJani Taskinen  }
687a541bb80SJani Taskinen}
688a541bb80SJani Taskinen
689a541bb80SJani Taskinen*** Testing single array argument ***
690a541bb80SJani Taskinenarray(0) {
691a541bb80SJani Taskinen}
692a541bb80SJani Taskinenarray(4) {
693a541bb80SJani Taskinen  ["a"]=>
694a541bb80SJani Taskinen  int(1)
695a541bb80SJani Taskinen  ["b"]=>
696a541bb80SJani Taskinen  string(6) "string"
697a541bb80SJani Taskinen  ["c"]=>
698a541bb80SJani Taskinen  NULL
699a541bb80SJani Taskinen  ["d"]=>
700a541bb80SJani Taskinen  float(-2.344)
701a541bb80SJani Taskinen}
702a541bb80SJani Taskinenarray(4) {
703a541bb80SJani Taskinen  [0]=>
704a541bb80SJani Taskinen  int(1)
705a541bb80SJani Taskinen  [1]=>
706a541bb80SJani Taskinen  string(6) "string"
707a541bb80SJani Taskinen  [2]=>
708a541bb80SJani Taskinen  NULL
709a541bb80SJani Taskinen  [3]=>
710a541bb80SJani Taskinen  float(-2.344)
711a541bb80SJani Taskinen}
712a541bb80SJani Taskinenarray(4) {
713a541bb80SJani Taskinen  [0]=>
714a541bb80SJani Taskinen  NULL
715a541bb80SJani Taskinen  [1]=>
716a541bb80SJani Taskinen  string(2) "Hi"
717a541bb80SJani Taskinen  ["string"]=>
718a541bb80SJani Taskinen  string(5) "hello"
719a541bb80SJani Taskinen  [2]=>
720a541bb80SJani Taskinen  array(3) {
721a541bb80SJani Taskinen    [""]=>
722a541bb80SJani Taskinen    string(5) "World"
723a541bb80SJani Taskinen    ["-2.34"]=>
724a541bb80SJani Taskinen    string(1) "a"
725a541bb80SJani Taskinen    [0]=>
726a541bb80SJani Taskinen    string(1) "b"
727a541bb80SJani Taskinen  }
728a541bb80SJani Taskinen}
729a541bb80SJani Taskinen
730a541bb80SJani Taskinen*** Testing array_merge() with typecasting non-array to array ***
731a541bb80SJani Taskinenarray(7) {
732a541bb80SJani Taskinen  ["a"]=>
733a541bb80SJani Taskinen  int(1)
734a541bb80SJani Taskinen  ["b"]=>
735a541bb80SJani Taskinen  string(6) "string"
736a541bb80SJani Taskinen  ["c"]=>
737a541bb80SJani Taskinen  NULL
738a541bb80SJani Taskinen  ["d"]=>
739a541bb80SJani Taskinen  float(-2.344)
740a541bb80SJani Taskinen  [0]=>
741a541bb80SJani Taskinen  string(5) "type1"
742a541bb80SJani Taskinen  [1]=>
743a541bb80SJani Taskinen  int(10)
744a541bb80SJani Taskinen  [2]=>
745a541bb80SJani Taskinen  float(12.34)
746a541bb80SJani Taskinen}
747a541bb80SJani Taskinen
748a541bb80SJani Taskinen*** Testing error conditions ***
749252d7d76SFelipe PenaWarning: array_merge() expects at least 1 parameter, 0 given in %s on line %d
750a541bb80SJani TaskinenNULL
751a541bb80SJani Taskinen
752efbf846fSGabriel CarusoWarning: array_merge(): Expected parameter 1 to be an array, int given in %s on line %d
753a541bb80SJani TaskinenNULL
754a541bb80SJani Taskinen
755efbf846fSGabriel CarusoWarning: array_merge(): Expected parameter 3 to be an array, int given in %s on line %d
756a541bb80SJani TaskinenNULL
757a541bb80SJani Taskinen
758a541bb80SJani TaskinenNotice: Undefined variable: arr4 in %s on line %d
759a541bb80SJani Taskinen
760efbf846fSGabriel CarusoWarning: array_merge(): Expected parameter 3 to be an array, null given in %s on line %d
761a541bb80SJani TaskinenNULL
762a541bb80SJani TaskinenDone
763