1--TEST--
2Test array_unshift() function : basic functionality - array with default keys for 'array' argument
3--FILE--
4<?php
5/*
6 * Testing array_unshift() by giving array with default keys for $array argument
7*/
8
9echo "*** Testing array_unshift() : basic functionality with default key array ***\n";
10
11// Initialise the array
12$array = array(1, 2);
13
14// Calling array_unshift() with default argument
15$temp_array = $array;
16// returns element count in the resulting array after arguments are pushed to
17// beginning of the given array
18var_dump( array_unshift($temp_array, 10) );
19
20// dump the resulting array
21var_dump($temp_array);
22
23// Calling array_unshift() with optional arguments
24$temp_array = $array;
25// returns element count in the resulting array after arguments are pushed to
26// beginning of the given array
27var_dump( array_unshift($temp_array, 222, "hello", 12.33) );
28
29// dump the resulting array
30var_dump($temp_array);
31
32echo "Done";
33?>
34--EXPECT--
35*** Testing array_unshift() : basic functionality with default key array ***
36int(3)
37array(3) {
38  [0]=>
39  int(10)
40  [1]=>
41  int(1)
42  [2]=>
43  int(2)
44}
45int(5)
46array(5) {
47  [0]=>
48  int(222)
49  [1]=>
50  string(5) "hello"
51  [2]=>
52  float(12.33)
53  [3]=>
54  int(1)
55  [4]=>
56  int(2)
57}
58Done
59