comparison.test 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. Comparison operators
  2. -----
  3. <?php
  4. $a < $b;
  5. $a <= $b;
  6. $a > $b;
  7. $a >= $b;
  8. $a == $b;
  9. $a === $b;
  10. $a != $b;
  11. $a !== $b;
  12. $a <=> $b;
  13. $a instanceof B;
  14. $a instanceof $b;
  15. -----
  16. array(
  17. 0: Stmt_Expression(
  18. expr: Expr_BinaryOp_Smaller(
  19. left: Expr_Variable(
  20. name: a
  21. )
  22. right: Expr_Variable(
  23. name: b
  24. )
  25. )
  26. )
  27. 1: Stmt_Expression(
  28. expr: Expr_BinaryOp_SmallerOrEqual(
  29. left: Expr_Variable(
  30. name: a
  31. )
  32. right: Expr_Variable(
  33. name: b
  34. )
  35. )
  36. )
  37. 2: Stmt_Expression(
  38. expr: Expr_BinaryOp_Greater(
  39. left: Expr_Variable(
  40. name: a
  41. )
  42. right: Expr_Variable(
  43. name: b
  44. )
  45. )
  46. )
  47. 3: Stmt_Expression(
  48. expr: Expr_BinaryOp_GreaterOrEqual(
  49. left: Expr_Variable(
  50. name: a
  51. )
  52. right: Expr_Variable(
  53. name: b
  54. )
  55. )
  56. )
  57. 4: Stmt_Expression(
  58. expr: Expr_BinaryOp_Equal(
  59. left: Expr_Variable(
  60. name: a
  61. )
  62. right: Expr_Variable(
  63. name: b
  64. )
  65. )
  66. )
  67. 5: Stmt_Expression(
  68. expr: Expr_BinaryOp_Identical(
  69. left: Expr_Variable(
  70. name: a
  71. )
  72. right: Expr_Variable(
  73. name: b
  74. )
  75. )
  76. )
  77. 6: Stmt_Expression(
  78. expr: Expr_BinaryOp_NotEqual(
  79. left: Expr_Variable(
  80. name: a
  81. )
  82. right: Expr_Variable(
  83. name: b
  84. )
  85. )
  86. )
  87. 7: Stmt_Expression(
  88. expr: Expr_BinaryOp_NotIdentical(
  89. left: Expr_Variable(
  90. name: a
  91. )
  92. right: Expr_Variable(
  93. name: b
  94. )
  95. )
  96. )
  97. 8: Stmt_Expression(
  98. expr: Expr_BinaryOp_Spaceship(
  99. left: Expr_Variable(
  100. name: a
  101. )
  102. right: Expr_Variable(
  103. name: b
  104. )
  105. )
  106. )
  107. 9: Stmt_Expression(
  108. expr: Expr_Instanceof(
  109. expr: Expr_Variable(
  110. name: a
  111. )
  112. class: Name(
  113. parts: array(
  114. 0: B
  115. )
  116. )
  117. )
  118. )
  119. 10: Stmt_Expression(
  120. expr: Expr_Instanceof(
  121. expr: Expr_Variable(
  122. name: a
  123. )
  124. class: Expr_Variable(
  125. name: b
  126. )
  127. )
  128. )
  129. )