summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_splice_variation4.phpt
blob: ddd966780e68ba028615882ad81c7a38b8ddea4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--TEST--
Test array_splice() function : usage variations - non array replacement values
--FILE--
<?php
/*
 * proto array array_splice(array input, int offset [, int length [, array replacement]])
 * Function is implemented in ext/standard/array.c
*/

function test_splice ($replacement)
{
	$input_array=array(0,1);
	var_dump (array_splice ($input_array,2,0,$replacement));
	var_dump ($input_array);
}

test_splice (2);

test_splice (2.1);

test_splice (true);
//file type resource
$file_handle = fopen(__FILE__, "r");

test_splice ($file_handle);
echo "Done\n";
?>
--EXPECTF--
array(0) {
}
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
array(0) {
}
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  float(2.1)
}
array(0) {
}
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  bool(true)
}
array(0) {
}
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  resource(%d) of type (stream)
}
Done