2011-11-26 17:10:18 +01:00
|
|
|
Different float syntaxes
|
|
|
|
-----
|
|
|
|
<?php
|
2011-11-27 11:20:35 +01:00
|
|
|
|
2011-11-26 17:10:18 +01:00
|
|
|
0.0;
|
|
|
|
0.;
|
|
|
|
.0;
|
|
|
|
0e0;
|
|
|
|
0E0;
|
|
|
|
0e+0;
|
|
|
|
0e-0;
|
|
|
|
30.20e10;
|
|
|
|
300.200e100;
|
|
|
|
1e10000;
|
2012-01-15 16:28:25 +01:00
|
|
|
|
|
|
|
// various integer -> float overflows
|
2012-06-08 18:19:37 +02:00
|
|
|
// (all are actually the same number, just in different representations)
|
|
|
|
18446744073709551615;
|
2012-01-15 16:28:25 +01:00
|
|
|
0xFFFFFFFFFFFFFFFF;
|
2012-06-08 18:19:37 +02:00
|
|
|
01777777777777777777777;
|
2015-07-14 19:21:38 +02:00
|
|
|
0177777777777777777777787;
|
2012-01-15 16:28:25 +01:00
|
|
|
0b1111111111111111111111111111111111111111111111111111111111111111;
|
2011-11-26 17:10:18 +01:00
|
|
|
-----
|
|
|
|
array(
|
2017-01-19 22:25:22 +01:00
|
|
|
0: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
1: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
2: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
3: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
4: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
5: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
6: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 0
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
7: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 302000000000
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
8: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 3.002E+102
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
9: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: INF
|
|
|
|
)
|
2011-11-26 17:10:18 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
10: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 1.844674407371E+19
|
|
|
|
comments: array(
|
|
|
|
0: // various integer -> float overflows
|
|
|
|
1: // (all are actually the same number, just in different representations)
|
|
|
|
)
|
|
|
|
)
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // various integer -> float overflows
|
|
|
|
1: // (all are actually the same number, just in different representations)
|
|
|
|
)
|
2012-01-15 16:28:25 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
11: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 1.844674407371E+19
|
|
|
|
)
|
2012-01-15 16:28:25 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
12: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 1.844674407371E+19
|
|
|
|
)
|
2012-01-15 16:28:25 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
13: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 1.844674407371E+19
|
|
|
|
)
|
2012-01-15 16:28:25 +01:00
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
14: Stmt_Expression(
|
|
|
|
expr: Scalar_DNumber(
|
|
|
|
value: 1.844674407371E+19
|
|
|
|
)
|
2015-07-14 19:21:38 +02:00
|
|
|
)
|
|
|
|
)
|