summaryrefslogtreecommitdiff
path: root/ext/standard/tests/math/bug27646.phpt
blob: 7b4a923f1f011222947f62cdf35a3678399c6350 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--TEST--
Bug #27646 (Cannot serialize/unserialize non-finite numeric values)
--FILE--
<?php
set_time_limit(5);

$f=12.3;
var_dump($f);
var_dump(serialize($f));
var_dump(unserialize(serialize($f)));

$f=-12.3;
var_dump($f);
var_dump(serialize($f));
var_dump(unserialize(serialize($f)));

$f=-INF;
var_dump($f);
var_dump(serialize($f));
var_dump(unserialize(serialize($f)));

$f=INF;
var_dump($f);
var_dump(serialize($f));
var_dump(unserialize(serialize($f)));

$f=NAN;
var_dump($f);
var_dump(serialize($f));
var_dump(unserialize(serialize($f)));

?>
--EXPECTF--
float(1%f)
string(%d) "d:1%s;"
float(1%f)
float(-1%f)
string(%d) "d:-1%s;"
float(-1%f)
float(-INF)
string(7) "d:-INF;"
float(-INF)
float(INF)
string(6) "d:INF;"
float(INF)
float(NAN)
string(6) "d:NAN;"
float(NAN)