newDeref.test 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. New expression dereferencing
  2. -----
  3. <?php
  4. (new A)->b;
  5. (new A)->b();
  6. (new A)['b'];
  7. (new A)['b']['c'];
  8. -----
  9. array(
  10. 0: Stmt_Expression(
  11. expr: Expr_PropertyFetch(
  12. var: Expr_New(
  13. class: Name(
  14. name: A
  15. )
  16. args: array(
  17. )
  18. )
  19. name: Identifier(
  20. name: b
  21. )
  22. )
  23. )
  24. 1: Stmt_Expression(
  25. expr: Expr_MethodCall(
  26. var: Expr_New(
  27. class: Name(
  28. name: A
  29. )
  30. args: array(
  31. )
  32. )
  33. name: Identifier(
  34. name: b
  35. )
  36. args: array(
  37. )
  38. )
  39. )
  40. 2: Stmt_Expression(
  41. expr: Expr_ArrayDimFetch(
  42. var: Expr_New(
  43. class: Name(
  44. name: A
  45. )
  46. args: array(
  47. )
  48. )
  49. dim: Scalar_String(
  50. value: b
  51. )
  52. )
  53. )
  54. 3: Stmt_Expression(
  55. expr: Expr_ArrayDimFetch(
  56. var: Expr_ArrayDimFetch(
  57. var: Expr_New(
  58. class: Name(
  59. name: A
  60. )
  61. args: array(
  62. )
  63. )
  64. dim: Scalar_String(
  65. value: b
  66. )
  67. )
  68. dim: Scalar_String(
  69. value: c
  70. )
  71. )
  72. )
  73. )