Mercurial > hg > isophonics-drupal-site
view vendor/nikic/php-parser/test/code/parser/stmt/switch.test @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | 5fb285c0d0e3 |
line wrap: on
line source
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( ) ) )