xref: /PHP-5.3/tests/lang/bug24640.phpt (revision 610c7fbe)
1--TEST--
2Bug #24640 (var_export and var_dump can't output large float)
3--INI--
4precision=12
5--FILE--
6<?php
7function test($v)
8{
9	echo var_export($v, true) . "\n";
10	var_dump($v);
11	echo "$v\n";
12	print_r($v);
13	echo "\n------\n";
14}
15
16test(1.7e+300);
17test(1.7e-300);
18test(1.7e+79);
19test(1.7e-79);
20test(1.7e+80);
21test(1.7e-80);
22test(1.7e+81);
23test(1.7e-81);
24test(1.7e+319);
25test(1.7e-319);
26test(1.7e+320);
27test(1.7e-320);
28test(1.7e+321);
29test(1.7e-321);
30test(1.7e+324);
31test(1.7e-324);
32test(1.7e+1000);
33test(1.7e-1000);
34
35?>
36===DONE===
37<?php exit(0); ?>
38--EXPECTF--
391.7E+300
40float(1.7E+300)
411.7E+300
421.7E+300
43------
441.7E-300
45float(1.7E-300)
461.7E-300
471.7E-300
48------
491.7E+79
50float(1.7E+79)
511.7E+79
521.7E+79
53------
541.7E-79
55float(1.7E-79)
561.7E-79
571.7E-79
58------
591.7E+80
60float(1.7E+80)
611.7E+80
621.7E+80
63------
641.7E-80
65float(1.7E-80)
661.7E-80
671.7E-80
68------
691.7E+81
70float(1.7E+81)
711.7E+81
721.7E+81
73------
741.7E-81
75float(1.7E-81)
761.7E-81
771.7E-81
78------
79I%s
80float(I%s)
81I%s
82I%s
83------
841.69998107421E-319
85float(1.69998107421E-319)
861.69998107421E-319
871.69998107421E-319
88------
89I%s
90float(I%s)
91I%s
92I%s
93------
941.70007988734E-320
95float(1.70007988734E-320)
961.70007988734E-320
971.70007988734E-320
98------
99I%s
100float(I%s)
101I%s
102I%s
103------
1041.69958582169E-321
105float(1.69958582169E-321)
1061.69958582169E-321
1071.69958582169E-321
108------
109I%s
110float(I%s)
111I%s
112I%s
113------
1140
115float(0)
1160
1170
118------
119I%s
120float(I%s)
121I%s
122I%s
123------
1240
125float(0)
1260
1270
128------
129===DONE===
130