protected function positionWithRef($node) { $posbit = 0; foreach ($node->params as $pos => $param) { if ($param->byRef == 1) { $posbit |= 1 << $pos; } } return $posbit; }