Lines Matching refs:array_shift
2 Test array_shift() function : usage variations - maintaining referenced elements
6 * From a comment left by Traps on 09-Jul-2007 on the array_shift documentation page:
7 * For those that may be trying to use array_shift() with an array containing references
8 * (e.g. working with linked node trees), beware that array_shift() may not work as you expect:
11 * The solution is to reference the first element before removing it with array_shift():
14 echo "*** Testing array_shift() : usage variations ***\n";
16 // using only array_shift:
17 echo "\n-- Reference result of array_shift: --\n";
20 $b =& array_shift($array);
25 echo "\n-- Reference first element before array_shift: --\n";
29 array_shift($array);
36 *** Testing array_shift() : usage variations ***
38 -- Reference result of array_shift: --
43 -- Reference first element before array_shift: --