File manager - Edit - /opt/cpanel/ea-php74/root/usr/share/tests/pecl/mongodb/tests/bson/bson-packedarray-fromPHP_error-001.phpt
Back
--TEST-- MongoDB\BSON\PackedArray::fromPHP(): requires a packed array --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $tests = [ [1 => 1, 2, 3], // Keys: 1, 2, 3 [1, 2 => 2, 3], // Keys: 0, 2, 3 [0, 1, 'foo' => 'bar'], // Keys: 0, 1, bar ]; foreach ($tests as $test) { echo throws(function() use ($test) { MongoDB\BSON\PackedArray::fromPHP($test); }, MongoDB\Driver\Exception\InvalidArgumentException::class), "\n"; } ?> ===DONE=== <?php exit(0); ?> --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected value to be a list, but given array is not OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected value to be a list, but given array is not OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected value to be a list, but given array is not ===DONE===
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings