Arquivos
hhvm/hphp/test/quick/array_cse.php
T
Bert Maher 8e34cbdf15 Allow CSE of ArrayGet by converting to IncRef
ArrayGet has fairly minimal side-effects: IncRef of its
result, and raising a warning if the element is undefined.  To CSE
ArrayGet, replace it with an IncRef of its destination.  Raising
multiple warnings for repeated accesses doesn't seem to have much
value, so just ignore them.
2013-06-03 10:54:38 -07:00

11 linhas
173 B
PHP

<?php
// Copyright 2004-present Facebook. All Rights Reserved.
function array_cse() {
$a = array(0,1,2,3,4);
$x = $a[2] + $a[2];
return $x;
}
var_dump(array_cse());