It seems this issue is limited to earlier versions of PHP under vBulletin, including at least PHP 5.3.3, although I cannot find a reference in the PHP changelogs where the behavior was ever changed between then and now. It could be a side effect of another bug fix like this:
https://bugs.php.net/bug.php?id=65821, which would explain why this behavior did not occur on this or our other vBulletin sites.
Basically, when a function returns by reference, and returns an array, it would follow that the return value of that function can be accessed as an array and its elements copied as reference to the original array, however in some versions of PHP:
Code:
function &array_access()
{
$arr = array('foo' => 'bar');
return $arr;
}
foreach (array_access() AS $foo => &$bar)
{
}
Throws a fatal error. It seems the compiler does not care that the function creates a reference, and assumes "Not a variable = Cannot reference!"
Anyway, the error can be avoided by breaking up the code in
vault/core/controller/hook/scope/vb3.php into additional lines.
Marked as fixed in the next build.