Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
thread-self
/
root
/
opt
/
php-8.3
/
share
/
test
/
mongodb
/
tests
/
bson
/
//proc/thread-self/root/opt/php-8.3/share/test/mongodb/tests/bson/bson-toPHP_error-003.phpt
--TEST-- MongoDB\BSON\toPHP(): BSON decoding exceptions for malformed documents --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $tests = array( pack('Vx', 4), // Empty document with invalid length (too small) pack('Vx', 6), // Empty document with invalid length (too large) ); foreach ($tests as $bson) { echo throws(function() use ($bson) { MongoDB\BSON\toPHP($bson); }, 'MongoDB\Driver\Exception\UnexpectedValueException'), "\n"; } ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s OK: Got MongoDB\Driver\Exception\UnexpectedValueException Could not read document from BSON reader Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s OK: Got MongoDB\Driver\Exception\UnexpectedValueException Could not read document from BSON reader ===DONE===