Annotation of embedaddon/php/ext/standard/tests/array/current_variation5.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
1.1.1.2 ! misho 2: Test current() function : usage variations - reference & normal parameters
1.1 misho 3: --FILE--
4: <?php
5: /* Prototype : mixed current(array $array_arg)
6: * Description: Return the element currently pointed to by the internal array pointer
7: * Source code: ext/standard/array.c
8: * Alias to functions: pos
9: */
10:
11: echo "*** Testing current() : usage variations ***\n";
12:
13: echo "\n-- Function: reference parameter --\n";
14:
15: function current_variation5_ref(&$a)
16: {
17: var_dump(current($a));
18: var_dump(next($a));
19: }
20:
21: $a = array('yes', 'maybe', 'no');
22:
23: var_dump(current($a));
24: var_dump(next($a));
25: current_variation5($a);
26:
27: echo "\n-- Function: normal parameter --\n";
28:
29: function current_variation5($a)
30: {
31: var_dump(current($a));
32: var_dump(next($a));
33: }
34:
35: $a = array('yes', 'maybe', 'no');
36:
37: var_dump(current($a));
38: var_dump(next($a));
39: current_variation5($a);
40:
41: ?>
42: ===DONE===
43: <?php exit(0); ?>
44: --EXPECTF--
45: *** Testing current() : usage variations ***
46:
47: -- Function: reference parameter --
48: string(3) "yes"
49: string(5) "maybe"
50: string(5) "maybe"
51: string(2) "no"
52:
53: -- Function: normal parameter --
54: string(3) "yes"
55: string(5) "maybe"
56: string(5) "maybe"
57: string(2) "no"
58: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>