1--TEST-- 2Test current() function : usage variations - referenced variables 3--FILE-- 4<?php 5/* 6 * Test how the internal pointer is affected when two variables are referenced to each other 7 */ 8 9echo "*** Testing current() : usage variations ***\n"; 10 11$array1 = array ('zero', 'one', 'two'); 12 13echo "\n-- Initial position of internal pointer --\n"; 14var_dump(current($array1)); 15next($array1); 16 17// Test that when two variables are referenced to one another 18// the internal pointer is the same for both 19$array2 = &$array1; 20echo "\n-- Position after calling next() --\n"; 21echo "\$array1: "; 22var_dump(current($array1)); 23echo "\$array2: "; 24var_dump(current($array2)); 25?> 26--EXPECT-- 27*** Testing current() : usage variations *** 28 29-- Initial position of internal pointer -- 30string(4) "zero" 31 32-- Position after calling next() -- 33$array1: string(3) "one" 34$array2: string(3) "one" 35