Arquivos
hhvm/hphp/test/vm/array-ref.php
T
bsimmers ea56a8383e Implement specialized array setting in VectorTranslator
This mimics what TranslatorX64 does in translateSetMArray,
but it does it with fewer helpers and (often) fewer instructions in
translated code. I also found a bug in both jits and the interpreter
when dealing with arrays that hold refs to themselves. The new test
case exercises the fix, which involved a bit of refactoring of the
refcounting logic.

Enabling VectorTranslator while punting to tx64 is no longer a
regression so I removed the punt in emit().
2013-03-19 14:11:16 -07:00

23 linhas
324 B
PHP

<?php
function yes() { return true; }
function main() {
$a = array();
$a['wat'] =& $a;
$b = $a; // Make sure the next line triggers COW
if (yes()) {
// Force a new tracelet
$a['wat'] = 5;
}
var_dump($a);
}
main();
function main2(&$a) {
$a = array();
$a['foo'] = 'flee';
}
main2($z);
var_dump($z);