blockConversion.test 353 B

1234567891011121314151617181920212223242526272829
  1. It may be necessary to convert a single statement into a block
  2. -----
  3. <?php
  4. if
  5. ($a) $b;
  6. -----
  7. // TODO Avoid fallback
  8. $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('c'));
  9. -----
  10. <?php
  11. if ($a) {
  12. $b;
  13. $c;
  14. }
  15. -----
  16. <?php
  17. if
  18. ($a) {$b;}
  19. -----
  20. $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('c'));
  21. -----
  22. <?php
  23. if
  24. ($a) {$b;
  25. $c;}