Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
opt
/
php-8.1
/
share
/
test
/
mongodb
/
tests
/
query
/
//opt/php-8.1/share/test/mongodb/tests/query/query-ctor-comment_error-001.phpt
--TEST-- MongoDB\Driver\Query::__construct(): comment option bsonSerialize() exception --FILE-- <?php require_once __DIR__ . "/../utils/basic.inc"; class Comment implements MongoDB\BSON\Serializable { #[\ReturnTypeWillChange] public function bsonSerialize(): array { throw new Exception('phongo_zval_to_bson_value fails'); } } echo throws(function() { new MongoDB\Driver\Query([], ['comment' => new Comment()]); }, Exception::class), "\n"; ?> ===DONE=== <?php exit(0); ?> --EXPECT-- OK: Got Exception phongo_zval_to_bson_value fails ===DONE===