protected function compileFunction(Op\Stmt\Function_ $func)
{
$signature = 'function ' . ($func->byRef ? '&' : '') . $func->name->value . '(';
$sep = '';
foreach ($func->params as $param) {
$signature .= $sep;
$sep = ', ';
$signature .= $param->result->type;
$signature .= $param->byRef ? ' &' : ' ';
$signature .= $this->getVarName($param->result);
}
$signature .= ') : ' . $func->returnType->value;
$code = $this->compileBody($func->stmts, ' ');
$this->state->functions[] = $signature . " {\n" . $code . "\n}";
}