You can use Doctrine MongoDB ODM with PHP 7, but there are a few extra steps during the installation. Since the legacy driver (referred to as
ext-mongo) is not available on PHP 7, you will need the new driver (ext-mongodb) installed and use a polyfill to provide the API of the legacy driver.
To do this, you have to require
alcaeus/mongo-php-adapter before adding a composer dependency to ODM. To do this, run the following command:
1. install adapter
composer config "platform.ext-mongo" "1.6.16" && composer require "alcaeus/mongo-php-adapter"
2. install driver
composer require doctrine/doctrine-mongo-odm-module