xref: /PHP-Parser/test/code/parser/scalar/float.test (revision 4e27a17c)
1Different float syntaxes
2-----
3<?php
4
50.0;
60.;
7.0;
80e0;
90E0;
100e+0;
110e-0;
1230.20e10;
13300.200e100;
141e10000;
15
16// various integer -> float overflows
17// (all are actually the same number, just in different representations)
1818446744073709551615;
190xFFFFFFFFFFFFFFFF;
200xEEEEEEEEEEEEEEEE;
2101777777777777777777777;
220177777777777777777777787;
230b1111111111111111111111111111111111111111111111111111111111111111;
24-----
25array(
26    0: Stmt_Expression(
27        expr: Scalar_Float(
28            value: 0
29        )
30    )
31    1: Stmt_Expression(
32        expr: Scalar_Float(
33            value: 0
34        )
35    )
36    2: Stmt_Expression(
37        expr: Scalar_Float(
38            value: 0
39        )
40    )
41    3: Stmt_Expression(
42        expr: Scalar_Float(
43            value: 0
44        )
45    )
46    4: Stmt_Expression(
47        expr: Scalar_Float(
48            value: 0
49        )
50    )
51    5: Stmt_Expression(
52        expr: Scalar_Float(
53            value: 0
54        )
55    )
56    6: Stmt_Expression(
57        expr: Scalar_Float(
58            value: 0
59        )
60    )
61    7: Stmt_Expression(
62        expr: Scalar_Float(
63            value: 302000000000
64        )
65    )
66    8: Stmt_Expression(
67        expr: Scalar_Float(
68            value: 3.002E+102
69        )
70    )
71    9: Stmt_Expression(
72        expr: Scalar_Float(
73            value: INF
74        )
75    )
76    10: Stmt_Expression(
77        expr: Scalar_Float(
78            value: 1.844674407371E+19
79        )
80        comments: array(
81            0: // various integer -> float overflows
82            1: // (all are actually the same number, just in different representations)
83        )
84    )
85    11: Stmt_Expression(
86        expr: Scalar_Float(
87            value: 1.844674407371E+19
88        )
89    )
90    12: Stmt_Expression(
91        expr: Scalar_Float(
92            value: 1.7216961135462E+19
93        )
94    )
95    13: Stmt_Expression(
96        expr: Scalar_Float(
97            value: 1.844674407371E+19
98        )
99    )
100    14: Stmt_Expression(
101        expr: Scalar_Float(
102            value: 1.844674407371E+19
103        )
104    )
105    15: Stmt_Expression(
106        expr: Scalar_Float(
107            value: 1.844674407371E+19
108        )
109    )
110)
111