Lines Matching refs:array_shift
2 Test array_shift() function : usage variations - maintaining referenced elements
5 /* Prototype : mixed array_shift(array &$stack)
11 * From a comment left by Traps on 09-Jul-2007 on the array_shift documentation page:
12 * For those that may be trying to use array_shift() with an array containing references
13 * (e.g. working with linked node trees), beware that array_shift() may not work as you expect:
16 * The solution is to reference the first element before removing it with array_shift():
19 echo "*** Testing array_shift() : usage variations ***\n";
21 // using only array_shift:
22 echo "\n-- Reference result of array_shift: --\n";
25 $b =& array_shift($array);
30 echo "\n-- Reference first element before array_shift: --\n";
34 array_shift($array);
41 *** Testing array_shift() : usage variations ***
43 -- Reference result of array_shift: --
48 -- Reference first element before array_shift: --