summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/current_basic.phpt
blob: f95ca85d192de6dd77700066a9fd5bf4234290fc (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
--TEST--
Test current() function : basic functionality
--FILE--
<?php
/* Prototype  : mixed current(array $array_arg)
 * Description: Return the element currently pointed to by the internal array pointer
 * Source code: ext/standard/array.c
 */

/*
 * Test basic functionality of current()
 */

echo "*** Testing current() : basic functionality ***\n";

$array = array ('zero', 'one', 'two', 'three' => 3);
var_dump(current($array));
next($array);
var_dump(current($array));
end($array);
var_dump(current($array));
next($array);
var_dump(current($array));
?>
===DONE===
--EXPECTF--
*** Testing current() : basic functionality ***
string(4) "zero"
string(3) "one"
int(3)
bool(false)
===DONE===