in reply to Pass array, then clear

Thank you for all for your comments and explanations. I suspected what was happening and it is good to get clarification. Also, it is insightful knowing that this behavior is typical of programming languages.

Replies are listed 'Best First'.
Re^2: Pass array, then clear
by ikegami (Patriarch) on Jan 16, 2018 at 16:41 UTC

    Not just in programming languages. If you have a key to a house in your hand, and someone replaces that key with the key to an empty house, the original house hasn't magically become empty.