Get MongoDB PHP Library Version?

I can fetch the version string for the MongoDB PHP Extension …

$r = new ReflectionExtension('mongodb');
print ($r->getVersion()); \\ currently prints '1.15.1'

Is there also a way to fetch the version of the MongoDB PHP Library?
Or are the extension and library in lock-step?

The major/minor version number of the library and extension are now kept in sync, but the patch version may differ depending on whether there’s a bug fix to make. If you are using Composer 2 (which you most likely are), there is a built-in way to get versions for installed packages: Knowing the version of package X.


Thanks Andreas, wfm. Didn’t know that facility was there in Composer :smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.