ConFoo Montreal 2026: Call for Papers

Voting

: min(four, one)?
(Example: nine)

The Note You're Voting On

scragar at gmail dot com
14 years ago
To clarify for anyone having problems with arrays, PHP will automatically pass arrays as references, cloning the array if needed in the event of setting or unsetting a part of it, changing a referenced variable does not trigger cloning.

This is done for efficiency, to clone an array containing this information you may either use a foreach loop, or set/unset a key. Techniques like array_values will also work provided you don't mind losing your keys.

<< Back to user notes page

To Top