📁 File Manager Pro
v10.0.3 | PHP: 7.4.33
Server: LiteSpeed
2026-07-12 04:54:11
📂
/ (Root)
/
opt
/
alt
/
tests
/
alt-php83-pecl-mongodb_1.18.1-1.el8
/
tests
📍 /opt/alt/tests/alt-php83-pecl-mongodb_1.18.1-1.el8/tests
🔄 Refresh
✏️
Editing: bson-timestamp-jsonserialize-002.phpt
Read Only
--TEST-- MongoDB\BSON\Timestamp::jsonSerialize() with json_encode() --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $doc = ['foo' => new MongoDB\BSON\Timestamp('1234', '5678')]; $json = json_encode($doc); echo toJSON(fromPHP($doc)), "\n"; echo $json, "\n"; var_dump(toPHP(fromJSON($json))); ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- { "foo" : { "$timestamp" : { "t" : 5678, "i" : 1234 } } } {"foo":{"$timestamp":{"t":5678,"i":1234}}} object(stdClass)#%d (%d) { ["foo"]=> object(MongoDB\BSON\Timestamp)#%d (%d) { ["increment"]=> string(4) "1234" ["timestamp"]=> string(4) "5678" } } ===DONE===
💾 Save Changes
❌ Cancel