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
/
bson
/
//opt/php-8.1/share/test/mongodb/tests/bson/bson-javascript-serialization_error-003.phpt
--TEST-- MongoDB\BSON\Javascript unserialization does not allow code to contain null bytes (Serializable interface) --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; echo throws(function() { unserialize('C:23:"MongoDB\BSON\Javascript":51:{a:1:{s:4:"code";s:26:"function() { return ' . "'\0'" . '; }";}}'); }, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n"; ?> ===DONE=== <?php exit(0); ?> --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException Code cannot contain null bytes ===DONE===