variable.test 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. Variable syntaxes
  2. -----
  3. <?php
  4. $a;
  5. ${'a'};
  6. ${foo()};
  7. $$a;
  8. $$$a;
  9. $$a['b'];
  10. -----
  11. !!php5
  12. array(
  13. 0: Stmt_Expression(
  14. expr: Expr_Variable(
  15. name: a
  16. )
  17. )
  18. 1: Stmt_Expression(
  19. expr: Expr_Variable(
  20. name: Scalar_String(
  21. value: a
  22. )
  23. )
  24. )
  25. 2: Stmt_Expression(
  26. expr: Expr_Variable(
  27. name: Expr_FuncCall(
  28. name: Name(
  29. parts: array(
  30. 0: foo
  31. )
  32. )
  33. args: array(
  34. )
  35. )
  36. )
  37. )
  38. 3: Stmt_Expression(
  39. expr: Expr_Variable(
  40. name: Expr_Variable(
  41. name: a
  42. )
  43. )
  44. )
  45. 4: Stmt_Expression(
  46. expr: Expr_Variable(
  47. name: Expr_Variable(
  48. name: Expr_Variable(
  49. name: a
  50. )
  51. )
  52. )
  53. )
  54. 5: Stmt_Expression(
  55. expr: Expr_Variable(
  56. name: Expr_ArrayDimFetch(
  57. var: Expr_Variable(
  58. name: a
  59. )
  60. dim: Scalar_String(
  61. value: b
  62. )
  63. )
  64. )
  65. )
  66. )