File manager - Edit - /opt/cpanel/ea-php74/root/usr/share/tests/pecl/mongodb/tests/query/query-ctor-comment_error-001.phpt
Back
--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===
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings