Annotation of embedaddon/php/ext/standard/tests/math/bug27646.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #27646 (Cannot serialize/unserialize non-finite numeric values)
! 3: --FILE--
! 4: <?php
! 5: set_time_limit(5);
! 6:
! 7: $f=12.3;
! 8: var_dump($f);
! 9: var_dump(serialize($f));
! 10: var_dump(unserialize(serialize($f)));
! 11:
! 12: $f=-12.3;
! 13: var_dump($f);
! 14: var_dump(serialize($f));
! 15: var_dump(unserialize(serialize($f)));
! 16:
! 17: $f=-INF;
! 18: var_dump($f);
! 19: var_dump(serialize($f));
! 20: var_dump(unserialize(serialize($f)));
! 21:
! 22: $f=INF;
! 23: var_dump($f);
! 24: var_dump(serialize($f));
! 25: var_dump(unserialize(serialize($f)));
! 26:
! 27: $f=NAN;
! 28: var_dump($f);
! 29: var_dump(serialize($f));
! 30: var_dump(unserialize(serialize($f)));
! 31:
! 32: ?>
! 33: --EXPECTF--
! 34: float(1%f)
! 35: string(%d) "d:1%s;"
! 36: float(1%f)
! 37: float(-1%f)
! 38: string(%d) "d:-1%s;"
! 39: float(-1%f)
! 40: float(-INF)
! 41: string(7) "d:-INF;"
! 42: float(-INF)
! 43: float(INF)
! 44: string(6) "d:INF;"
! 45: float(INF)
! 46: float(NAN)
! 47: string(6) "d:NAN;"
! 48: float(NAN)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>