pub enum StmtKind {
Show 32 variants
Expression(Box<Expr>),
Echo(Box<[Expr]>),
Return(Option<Box<Expr>>),
Block(Box<Block>),
If(Box<IfStmt>),
While(Box<WhileStmt>),
For(Box<ForStmt>),
Foreach(Box<ForeachStmt>),
DoWhile(Box<DoWhileStmt>),
Function(Box<FunctionDecl>),
Break(Option<Box<Expr>>),
Continue(Option<Box<Expr>>),
Switch(Box<SwitchStmt>),
Goto(Ident),
Label(Box<str>),
Declare(Box<DeclareStmt>),
Unset(Box<[Expr]>),
Throw(Box<Expr>),
TryCatch(Box<TryCatchStmt>),
Global(Box<[Expr]>),
Class(Box<ClassDecl>),
Interface(Box<InterfaceDecl>),
Trait(Box<TraitDecl>),
Enum(Box<EnumDecl>),
Namespace(Box<NamespaceDecl>),
Use(Box<UseDecl>),
Const(Box<[ConstItem]>),
StaticVar(Box<[StaticVar]>),
HaltCompiler(Box<str>),
Nop,
InlineHtml(Box<str>),
Error,
}Expand description
The kind of a statement.
Variants§
Expression(Box<Expr>)
An expression statement.
Echo(Box<[Expr]>)
echo with one or more expressions.
Return(Option<Box<Expr>>)
return with optional value.
Block(Box<Block>)
A nested block.
If(Box<IfStmt>)
An if statement.
While(Box<WhileStmt>)
A while loop.
For(Box<ForStmt>)
A for loop.
Foreach(Box<ForeachStmt>)
A foreach loop.
DoWhile(Box<DoWhileStmt>)
A do ... while loop.
Function(Box<FunctionDecl>)
A function declaration.
Break(Option<Box<Expr>>)
break with optional level.
Continue(Option<Box<Expr>>)
continue with optional level.
Switch(Box<SwitchStmt>)
A switch statement.
Goto(Ident)
goto with target label.
Label(Box<str>)
A label: definition.
Declare(Box<DeclareStmt>)
A declare(...) statement.
Unset(Box<[Expr]>)
unset(...) targets.
Throw(Box<Expr>)
A throw statement.
TryCatch(Box<TryCatchStmt>)
A try/catch/finally statement.
Global(Box<[Expr]>)
global variables.
Class(Box<ClassDecl>)
A class declaration.
Interface(Box<InterfaceDecl>)
An interface declaration.
Trait(Box<TraitDecl>)
A trait declaration.
Enum(Box<EnumDecl>)
An enum declaration.
Namespace(Box<NamespaceDecl>)
A namespace declaration.
Use(Box<UseDecl>)
A use import.
Const(Box<[ConstItem]>)
A top-level const statement.
StaticVar(Box<[StaticVar]>)
A static variable statement.
HaltCompiler(Box<str>)
__halt_compiler() with the trailing raw data.
Nop
An empty statement (;).
InlineHtml(Box<str>)
Text outside PHP tags.
Error
Placeholder for a statement that failed to parse.