Annotation of embedaddon/php/ext/xmlrpc/tests/bug40576.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #40576 (double values are truncated to 6 decimal digits when encoding)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("xmlrpc")) print "skip";
! 6: if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
! 7: ?>
! 8: --INI--
! 9: precision=12
! 10: --FILE--
! 11: <?php
! 12:
! 13: var_dump(xmlrpc_encode(1.123456789));
! 14: var_dump(xmlrpc_encode(11234567891010));
! 15: var_dump(xmlrpc_encode(11234567));
! 16: var_dump(xmlrpc_encode(""));
! 17: var_dump(xmlrpc_encode("test"));
! 18: var_dump(xmlrpc_encode("1.22222222222222222222222"));
! 19:
! 20: echo "Done\n";
! 21: ?>
! 22: --EXPECTF--
! 23: string(125) "<?xml version="1.0" encoding="utf-8"?>
! 24: <params>
! 25: <param>
! 26: <value>
! 27: <double>1.123456789</double>
! 28: </value>
! 29: </param>
! 30: </params>
! 31: "
! 32: string(130) "<?xml version="1.0" encoding="utf-8"?>
! 33: <params>
! 34: <param>
! 35: <value>
! 36: <double>1.1234567891E+13</double>
! 37: </value>
! 38: </param>
! 39: </params>
! 40: "
! 41: string(116) "<?xml version="1.0" encoding="utf-8"?>
! 42: <params>
! 43: <param>
! 44: <value>
! 45: <int>11234567</int>
! 46: </value>
! 47: </param>
! 48: </params>
! 49: "
! 50: string(106) "<?xml version="1.0" encoding="utf-8"?>
! 51: <params>
! 52: <param>
! 53: <value>
! 54: <string/>
! 55: </value>
! 56: </param>
! 57: </params>
! 58: "
! 59: string(118) "<?xml version="1.0" encoding="utf-8"?>
! 60: <params>
! 61: <param>
! 62: <value>
! 63: <string>test</string>
! 64: </value>
! 65: </param>
! 66: </params>
! 67: "
! 68: string(139) "<?xml version="1.0" encoding="utf-8"?>
! 69: <params>
! 70: <param>
! 71: <value>
! 72: <string>1.22222222222222222222222</string>
! 73: </value>
! 74: </param>
! 75: </params>
! 76: "
! 77: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>