issetAndEmpty.test 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. isset() and empty()
  2. -----
  3. <?php
  4. isset($a);
  5. isset($a, $b, $c);
  6. empty($a);
  7. empty(foo());
  8. empty(array(1, 2, 3));
  9. -----
  10. array(
  11. 0: Stmt_Expression(
  12. expr: Expr_Isset(
  13. vars: array(
  14. 0: Expr_Variable(
  15. name: a
  16. )
  17. )
  18. )
  19. )
  20. 1: Stmt_Expression(
  21. expr: Expr_Isset(
  22. vars: array(
  23. 0: Expr_Variable(
  24. name: a
  25. )
  26. 1: Expr_Variable(
  27. name: b
  28. )
  29. 2: Expr_Variable(
  30. name: c
  31. )
  32. )
  33. )
  34. )
  35. 2: Stmt_Expression(
  36. expr: Expr_Empty(
  37. expr: Expr_Variable(
  38. name: a
  39. )
  40. )
  41. )
  42. 3: Stmt_Expression(
  43. expr: Expr_Empty(
  44. expr: Expr_FuncCall(
  45. name: Name(
  46. parts: array(
  47. 0: foo
  48. )
  49. )
  50. args: array(
  51. )
  52. )
  53. )
  54. )
  55. 4: Stmt_Expression(
  56. expr: Expr_Empty(
  57. expr: Expr_Array(
  58. items: array(
  59. 0: Expr_ArrayItem(
  60. key: null
  61. value: Scalar_LNumber(
  62. value: 1
  63. )
  64. byRef: false
  65. )
  66. 1: Expr_ArrayItem(
  67. key: null
  68. value: Scalar_LNumber(
  69. value: 2
  70. )
  71. byRef: false
  72. )
  73. 2: Expr_ArrayItem(
  74. key: null
  75. value: Scalar_LNumber(
  76. value: 3
  77. )
  78. byRef: false
  79. )
  80. )
  81. )
  82. )
  83. )
  84. )