blob: c5636e8f33b60b312193c6420f924b16a9a2839f (
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
|
--TEST--
Test array_shift behaviour
--POST--
--GET--
--FILE--
<?php
array_shift($GLOBALS);
$a = array("foo", "bar", "fubar");
$b = array("3" => "foo", "4" => "bar", "5" => "fubar");
$c = array("a" => "foo", "b" => "bar", "c" => "fubar");
/* simple array */
echo array_shift($a), "\n";
var_dump($a);
/* numerical assoc indices */
echo array_shift($b), "\n";
var_dump($b);
/* assoc indices */
echo array_shift($c), "\n";
var_dump($c);
?>
--EXPECT--
foo
array(2) {
[0]=>
string(3) "bar"
[1]=>
string(5) "fubar"
}
foo
array(2) {
[0]=>
string(3) "bar"
[1]=>
string(5) "fubar"
}
foo
array(2) {
["b"]=>
string(3) "bar"
["c"]=>
string(5) "fubar"
}
|