float.test 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Different float syntaxes
  2. -----
  3. <?php
  4. 0.0;
  5. 0.;
  6. .0;
  7. 0e0;
  8. 0E0;
  9. 0e+0;
  10. 0e-0;
  11. 30.20e10;
  12. 300.200e100;
  13. 1e10000;
  14. // various integer -> float overflows
  15. // (all are actually the same number, just in different representations)
  16. 18446744073709551615;
  17. 0xFFFFFFFFFFFFFFFF;
  18. 01777777777777777777777;
  19. 0177777777777777777777787;
  20. 0b1111111111111111111111111111111111111111111111111111111111111111;
  21. -----
  22. array(
  23. 0: Stmt_Expression(
  24. expr: Scalar_DNumber(
  25. value: 0
  26. )
  27. )
  28. 1: Stmt_Expression(
  29. expr: Scalar_DNumber(
  30. value: 0
  31. )
  32. )
  33. 2: Stmt_Expression(
  34. expr: Scalar_DNumber(
  35. value: 0
  36. )
  37. )
  38. 3: Stmt_Expression(
  39. expr: Scalar_DNumber(
  40. value: 0
  41. )
  42. )
  43. 4: Stmt_Expression(
  44. expr: Scalar_DNumber(
  45. value: 0
  46. )
  47. )
  48. 5: Stmt_Expression(
  49. expr: Scalar_DNumber(
  50. value: 0
  51. )
  52. )
  53. 6: Stmt_Expression(
  54. expr: Scalar_DNumber(
  55. value: 0
  56. )
  57. )
  58. 7: Stmt_Expression(
  59. expr: Scalar_DNumber(
  60. value: 302000000000
  61. )
  62. )
  63. 8: Stmt_Expression(
  64. expr: Scalar_DNumber(
  65. value: 3.002E+102
  66. )
  67. )
  68. 9: Stmt_Expression(
  69. expr: Scalar_DNumber(
  70. value: INF
  71. )
  72. )
  73. 10: Stmt_Expression(
  74. expr: Scalar_DNumber(
  75. value: 1.844674407371E+19
  76. comments: array(
  77. 0: // various integer -> float overflows
  78. 1: // (all are actually the same number, just in different representations)
  79. )
  80. )
  81. comments: array(
  82. 0: // various integer -> float overflows
  83. 1: // (all are actually the same number, just in different representations)
  84. )
  85. )
  86. 11: Stmt_Expression(
  87. expr: Scalar_DNumber(
  88. value: 1.844674407371E+19
  89. )
  90. )
  91. 12: Stmt_Expression(
  92. expr: Scalar_DNumber(
  93. value: 1.844674407371E+19
  94. )
  95. )
  96. 13: Stmt_Expression(
  97. expr: Scalar_DNumber(
  98. value: 1.844674407371E+19
  99. )
  100. )
  101. 14: Stmt_Expression(
  102. expr: Scalar_DNumber(
  103. value: 1.844674407371E+19
  104. )
  105. )
  106. )