1--TEST--
2Test var_export() function with valid float values
3--INI--
4serialize_precision=17
5--FILE--
6<?php
7echo "*** Testing var_export() with valid float values ***\n";
8// different valid  float values
9$valid_floats = array(
10      "-2147483649" => (float)-2147483649, // float value
11      "2147483648" => (float)2147483648,  // float value
12      "-0x80000001" => (float)-0x80000001, // float value, beyond max negative int
13      "0x800000001" => (float)0x800000001, // float value, beyond max positive int
14      "020000000001" => (float)020000000001, // float value, beyond max positive int
15      "-020000000001" => (float)-020000000001, // float value, beyond max negative int
16      "0.0" => 0.0,
17      "-0.1" => -0.1,
18      "10.0000000000000000005" => 10.0000000000000000005,
19      "10.5e+5" => 10.5e+5,
20      "1e5" => 1e5,
21      "1e-5" => 1e-5,
22      "1e+5" => 1e+5,
23      "1E5" => 1E5,
24      "1E+5" => 1E+5,
25      "1E-5" => 1E-5,
26      ".5e+7" => .5e+7,
27      ".6e-19" => .6e-19,
28      ".05E+44" => .05E+44,
29      ".0034E-30" => .0034E-30
30);
31/* Loop to check for above float values with var_export() */
32echo "\n*** Output for float values ***\n";
33foreach($valid_floats as $key => $float_value) {
34    echo "\n-- Iteration: $key --\n";
35    var_export( $float_value );
36    echo "\n";
37    var_export( $float_value, FALSE);
38    echo "\n";
39    var_dump( var_export( $float_value, TRUE) );
40    echo "\n";
41}
42
43?>
44--EXPECT--
45*** Testing var_export() with valid float values ***
46
47*** Output for float values ***
48
49-- Iteration: -2147483649 --
50-2147483649.0
51-2147483649.0
52string(13) "-2147483649.0"
53
54
55-- Iteration: 2147483648 --
562147483648.0
572147483648.0
58string(12) "2147483648.0"
59
60
61-- Iteration: -0x80000001 --
62-2147483649.0
63-2147483649.0
64string(13) "-2147483649.0"
65
66
67-- Iteration: 0x800000001 --
6834359738369.0
6934359738369.0
70string(13) "34359738369.0"
71
72
73-- Iteration: 020000000001 --
742147483649.0
752147483649.0
76string(12) "2147483649.0"
77
78
79-- Iteration: -020000000001 --
80-2147483649.0
81-2147483649.0
82string(13) "-2147483649.0"
83
84
85-- Iteration: 0.0 --
860.0
870.0
88string(3) "0.0"
89
90
91-- Iteration: -0.1 --
92-0.10000000000000001
93-0.10000000000000001
94string(20) "-0.10000000000000001"
95
96
97-- Iteration: 10.0000000000000000005 --
9810.0
9910.0
100string(4) "10.0"
101
102
103-- Iteration: 10.5e+5 --
1041050000.0
1051050000.0
106string(9) "1050000.0"
107
108
109-- Iteration: 1e5 --
110100000.0
111100000.0
112string(8) "100000.0"
113
114
115-- Iteration: 1e-5 --
1161.0000000000000001E-5
1171.0000000000000001E-5
118string(21) "1.0000000000000001E-5"
119
120
121-- Iteration: 1e+5 --
122100000.0
123100000.0
124string(8) "100000.0"
125
126
127-- Iteration: 1E5 --
128100000.0
129100000.0
130string(8) "100000.0"
131
132
133-- Iteration: 1E+5 --
134100000.0
135100000.0
136string(8) "100000.0"
137
138
139-- Iteration: 1E-5 --
1401.0000000000000001E-5
1411.0000000000000001E-5
142string(21) "1.0000000000000001E-5"
143
144
145-- Iteration: .5e+7 --
1465000000.0
1475000000.0
148string(9) "5000000.0"
149
150
151-- Iteration: .6e-19 --
1526.0000000000000006E-20
1536.0000000000000006E-20
154string(22) "6.0000000000000006E-20"
155
156
157-- Iteration: .05E+44 --
1585.0000000000000001E+42
1595.0000000000000001E+42
160string(22) "5.0000000000000001E+42"
161
162
163-- Iteration: .0034E-30 --
1643.4000000000000001E-33
1653.4000000000000001E-33
166string(22) "3.4000000000000001E-33"
167
168