1--TEST--
2Test end() 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 end() : usage variations ***\n";
10
11$array1 = array ('zero', 'one', 'two');
12
13echo "\n-- Initial position of internal pointer --\n";
14var_dump(current($array1));
15end($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 end() --\n";
21echo "\$array1: ";
22var_dump(current($array1));
23echo "\$array2: ";
24var_dump(current($array2));
25?>
26--EXPECT--
27*** Testing end() : usage variations ***
28
29-- Initial position of internal pointer --
30string(4) "zero"
31
32-- Position after calling end() --
33$array1: string(3) "two"
34$array2: string(3) "two"
35