xref: /php-src/ext/bcmath/tests/number/serialize.phpt (revision fad899e5)
1--TEST--
2BcMath\Number serialize
3--EXTENSIONS--
4bcmath
5--FILE--
6<?php
7
8$values = [
9    '0',
10    '0.0',
11    '2',
12    '1234',
13    '12.0004',
14    '0.1230',
15    1,
16    12345,
17];
18
19foreach ($values as $value) {
20    $num = new BcMath\Number($value);
21    echo serialize($num) . "\n";
22}
23?>
24--EXPECT--
25O:13:"BcMath\Number":1:{s:5:"value";s:1:"0";}
26O:13:"BcMath\Number":1:{s:5:"value";s:3:"0.0";}
27O:13:"BcMath\Number":1:{s:5:"value";s:1:"2";}
28O:13:"BcMath\Number":1:{s:5:"value";s:4:"1234";}
29O:13:"BcMath\Number":1:{s:5:"value";s:7:"12.0004";}
30O:13:"BcMath\Number":1:{s:5:"value";s:6:"0.1230";}
31O:13:"BcMath\Number":1:{s:5:"value";s:1:"1";}
32O:13:"BcMath\Number":1:{s:5:"value";s:5:"12345";}
33