File manager - Edit - /opt/cpanel/ea-php74/root/usr/share/tests/pecl/mongodb/tests/bson-corpus/decimal128-1-valid-059.phpt
Back
--TEST-- Decimal128: Clamped negative zeros with a large positive exponent --DESCRIPTION-- Generated by scripts/convert-bson-corpus-tests.php DO NOT EDIT THIS FILE --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $canonicalBson = hex2bin('180000001364000000000000000000000000000000FEDF00'); $canonicalExtJson = '{"d" : {"$numberDecimal" : "-0E+6111"}}'; $degenerateExtJson = '{"d" : {"$numberDecimal" : "-0E+2147483647"}}'; // Canonical BSON -> BSON object -> Canonical BSON echo bin2hex((string) MongoDB\BSON\Document::fromBSON($canonicalBson)), "\n"; // Canonical BSON -> BSON object -> Canonical extJSON echo json_canonicalize(MongoDB\BSON\Document::fromBSON($canonicalBson)->toCanonicalExtendedJSON()), "\n"; // Canonical extJSON -> BSON object -> Canonical BSON echo bin2hex((string) MongoDB\BSON\Document::fromJSON($canonicalExtJson)), "\n"; // Degenerate extJSON -> BSON object -> Canonical BSON echo bin2hex((string) MongoDB\BSON\Document::fromJSON($degenerateExtJson)), "\n"; ?> ===DONE=== <?php exit(0); ?> --EXPECT-- 180000001364000000000000000000000000000000fedf00 {"d":{"$numberDecimal":"-0E+6111"}} 180000001364000000000000000000000000000000fedf00 180000001364000000000000000000000000000000fedf00 ===DONE===
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings