throw.test 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Throw expression
  2. -----
  3. <?php
  4. test(throw $x);
  5. $a ?? throw new Exception;
  6. -----
  7. !!php7
  8. array(
  9. 0: Stmt_Expression(
  10. expr: Expr_FuncCall(
  11. name: Name(
  12. parts: array(
  13. 0: test
  14. )
  15. )
  16. args: array(
  17. 0: Arg(
  18. name: null
  19. value: Expr_Throw(
  20. expr: Expr_Variable(
  21. name: x
  22. )
  23. )
  24. byRef: false
  25. unpack: false
  26. )
  27. )
  28. )
  29. )
  30. 1: Stmt_Expression(
  31. expr: Expr_BinaryOp_Coalesce(
  32. left: Expr_Variable(
  33. name: a
  34. )
  35. right: Expr_Throw(
  36. expr: Expr_New(
  37. class: Name(
  38. parts: array(
  39. 0: Exception
  40. )
  41. )
  42. args: array(
  43. )
  44. )
  45. )
  46. )
  47. )
  48. )