function ParserAbstract::createExitExpr
Parameters
array<Node\Arg|Node\VariadicPlaceholder> $args:
array<string, mixed> $attrs:
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php, line 1216
Class
Namespace
PhpParserCode
protected function createExitExpr(string $name, int $namePos, array $args, array $attrs) : Expr {
if ($this->isSimpleExit($args)) {
// Create Exit node for backwards compatibility.
$attrs['kind'] = strtolower($name) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
return new Expr\Exit_(\count($args) === 1 ? $args[0]->value : null, $attrs);
}
return new Expr\FuncCall(new Name($name, $this->getAttributesAt($namePos)), $args, $attrs);
}