mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-11 17:09:41 +01:00
9d8e13b4a9
Not that it makes much of a difference, but could have caused issues with "out of order" visiting of nodes.
67 lines
1.1 KiB
Plaintext
67 lines
1.1 KiB
Plaintext
Switch
|
|
-----
|
|
<?php
|
|
|
|
switch ($a) {
|
|
case 0:
|
|
case 1;
|
|
default:
|
|
}
|
|
|
|
// alternative syntax
|
|
switch ($a):
|
|
endswitch;
|
|
|
|
// leading semicolon
|
|
switch ($a) { ; }
|
|
switch ($a): ; endswitch;
|
|
-----
|
|
array(
|
|
0: Stmt_Switch(
|
|
cond: Expr_Variable(
|
|
name: a
|
|
)
|
|
cases: array(
|
|
0: Stmt_Case(
|
|
cond: Scalar_LNumber(
|
|
value: 0
|
|
)
|
|
stmts: array(
|
|
)
|
|
)
|
|
1: Stmt_Case(
|
|
cond: Scalar_LNumber(
|
|
value: 1
|
|
)
|
|
stmts: array(
|
|
)
|
|
)
|
|
2: Stmt_Case(
|
|
cond: null
|
|
stmts: array(
|
|
)
|
|
)
|
|
)
|
|
)
|
|
1: Stmt_Switch(
|
|
cond: Expr_Variable(
|
|
name: a
|
|
)
|
|
cases: array(
|
|
)
|
|
)
|
|
2: Stmt_Switch(
|
|
cond: Expr_Variable(
|
|
name: a
|
|
)
|
|
cases: array(
|
|
)
|
|
)
|
|
3: Stmt_Switch(
|
|
cond: Expr_Variable(
|
|
name: a
|
|
)
|
|
cases: array(
|
|
)
|
|
)
|
|
) |