File manager - Edit - /opt/cpanel/ea-php74/root/usr/share/tests/pecl/mongodb/tests/bson/bson-packedarray-toRelaxedExtendedJSON-002.phpt
Back
--TEST-- MongoDB\BSON\PackedArray::toRelaxedExtendedJSON(): Encoding extended JSON types --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $tests = [ [ new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], [ new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], [ new MongoDB\BSON\UTCDateTime(1445990400000) ], [ new MongoDB\BSON\Timestamp(1234, 5678) ], [ new MongoDB\BSON\Regex('pattern', 'i') ], [ new MongoDB\BSON\Javascript('function() { return 1; }') ], [ new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1]) ], [ new MongoDB\BSON\MinKey ], [ new MongoDB\BSON\MaxKey ], ]; foreach ($tests as $value) { echo MongoDB\BSON\PackedArray::fromPHP($value)->toRelaxedExtendedJSON(), "\n"; } ?> ===DONE=== <?php exit(0); ?> --EXPECT-- [ { "$oid" : "56315a7c6118fd1b920270b1" } ] [ { "$binary" : { "base64" : "Zm9v", "subType" : "00" } } ] [ { "$date" : "2015-10-28T00:00:00Z" } ] [ { "$timestamp" : { "t" : 5678, "i" : 1234 } } ] [ { "$regularExpression" : { "pattern" : "pattern", "options" : "i" } } ] [ { "$code" : "function() { return 1; }" } ] [ { "$code" : "function() { return a; }", "$scope" : { "a" : 1 } } ] [ { "$minKey" : 1 } ] [ { "$maxKey" : 1 } ] ===DONE===
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings