Give the gift of Drupal. All merchandise is 50% off through 2016.
Not sure if this is php version specific but through some tricks of references raw_variables get the converted values changed. The attached patch explicitly copies the array into a new array. This breaks references, try running
php -r '$a = 1; $b = array(&$a); foreach ($b as $v) $v++; var_dump($a);' and see that despite
$b is a reference to
$a, when foreaching over it, the reference is not preserved. Tests to confirm bug and fix.
Thanks to @dawehner for the test and figuring out where the bug was and @chx and @eclipsegc for talking it through and helping us figure out what was causing it.
PASSED: [[SimpleTest]]: [MySQL] 58,859 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 58,378 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 58,690 pass(es). View