The PHP team is happy to announce that version 1.9.0 of the mongodb PHP extension is now available on PECL.
This release makes the extension compatible with PHP 8.
This release ensures that all functions in the extension throw
MongoDB\Driver\Exception\InvalidArgumentException instead of emitting a PHP error or warning during argument parsing (e.g.
E_WARNING). Previous versions of the driver generally only did this for constructors, which was inconsistent. Note that this behavior does not apply to cases where PHP throws an Error (e.g. TypeError), which is done more consistently in PHP 8 (see: Consistent Type Errors).
MongoDB\Driver\Cursor class now implements the
Iterator interface directly. This change was necessary to ensure consistent behavior across all supported PHP versions.
A complete list of resolved issues in this release may be found at: Release Notes - MongoDB Jira
We would appreciate any feedback you might have on the project:
You can either download and install the source manually, or you can install the extension with:
pecl install mongodb-1.9.0
or update with:
pecl upgrade mongodb-1.9.0
Windows binaries are available on PECL: