xref: /PHP-7.4/ext/standard/tests/serialize/003.phpt (revision 782352c5)
1--TEST--
2unserialize() floats with E notation (#18654)
3--INI--
4precision=12
5serialize_precision=100
6--FILE--
7<?php
8foreach(array(1e2, 5.2e25, 85.29e-23, 9e-9) AS $value) {
9	echo ($ser = serialize($value))."\n";
10	var_dump(unserialize($ser));
11	echo "\n";
12}
13?>
14--EXPECTREGEX--
15d:100;
16float\(100\)
17
18d:5[0-9]*;
19float\(5\.2E\+25\)
20
21d:8\.52[89][0-9]+E-22;
22float\(8\.529E-22\)
23
24d:8\.[9]*[0-9]*E-9;
25float\(9\.0E-9\)
26