in reply to volatile memory?

Of course, in between $array[0] = new_value; and $array[0] = $buffer;, you can expect their values to differ.

Either you're not measuring what you think you're measuring, or you're dealing with a tied variable or an object that overloads some operators, in which case all bets about how things should behave are off.