1--TEST-- 2Test current() function : usage variations - reference & normal parameters 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 11echo "*** Testing current() : usage variations ***\n"; 12 13echo "\n-- Function: reference parameter --\n"; 14 15function current_variation5_ref(&$a) 16{ 17 var_dump(current($a)); 18 var_dump(next($a)); 19} 20 21$a = array('yes', 'maybe', 'no'); 22 23var_dump(current($a)); 24var_dump(next($a)); 25current_variation5($a); 26 27echo "\n-- Function: normal parameter --\n"; 28 29function current_variation5($a) 30{ 31 var_dump(current($a)); 32 var_dump(next($a)); 33} 34 35$a = array('yes', 'maybe', 'no'); 36 37var_dump(current($a)); 38var_dump(next($a)); 39current_variation5($a); 40 41?> 42===DONE=== 43<?php exit(0); ?> 44--EXPECTF-- 45*** Testing current() : usage variations *** 46 47-- Function: reference parameter -- 48string(3) "yes" 49string(5) "maybe" 50string(5) "maybe" 51string(2) "no" 52 53-- Function: normal parameter -- 54string(3) "yes" 55string(5) "maybe" 56string(5) "maybe" 57string(2) "no" 58===DONE=== 59