📁 File Manager Pro
v10.0.3 | PHP: 7.4.33
Server: LiteSpeed
2026-07-12 05:35:16
📂
/ (Root)
/
opt
/
alt
/
tests
/
alt-php84-pecl-mongodb_1.20.0-2.el8
/
tests
📍 /opt/alt/tests/alt-php84-pecl-mongodb_1.20.0-2.el8/tests
🔄 Refresh
✏️
Editing: bson-utcdatetime-jsonserialize-002.phpt
Read Only
--TEST-- MongoDB\BSON\UTCDateTime::jsonSerialize() with json_encode() --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $doc = ['foo' => new MongoDB\BSON\UTCDateTime(new DateTime('2016-10-11 13:34:26.817 UTC'))]; $json = json_encode($doc); echo toJSON(fromPHP($doc)), "\n"; echo $json, "\n"; var_dump(toPHP(fromJSON($json))); ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- { "foo" : { "$date" : { "$numberLong" : "1476192866817" } } } {"foo":{"$date":{"$numberLong":"1476192866817"}}} object(stdClass)#%d (%d) { ["foo"]=> object(MongoDB\BSON\UTCDateTime)#%d (%d) { ["milliseconds"]=> string(13) "1476192866817" } } ===DONE===
💾 Save Changes
❌ Cancel