blob: 69a269f11f416e3a49895e5dcc9321e994965373 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--TEST--
filter_var() and double overflow/underflow
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
$test = array(
'1e+308' => 1e+308,
'1e+309' => false,
'1e-323' => 1e-323,
'1e-324' => false,
);
foreach ($test as $src => $dst) {
$out = filter_var($src, FILTER_VALIDATE_FLOAT);
if ($dst !== $out) {
if ($out === false) {
echo "$src -> false != $dst\n";
} elseif ($dst === false) {
echo "$src -> $out != false\n";
} else {
echo "$src -> $out != $dst\n";
}
}
}
echo "Ok\n";
?>
--EXPECT--
Ok
|