12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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(
- )
- comments: array(
- 0: // alternative syntax
- )
- )
- 2: Stmt_Switch(
- cond: Expr_Variable(
- name: a
- )
- cases: array(
- )
- comments: array(
- 0: // leading semicolon
- )
- )
- 3: Stmt_Switch(
- cond: Expr_Variable(
- name: a
- )
- cases: array(
- )
- )
- )
|