- The pure PHP reader now rejects non-string map keys with
InvalidDatabaseExceptioninstead of aTypeError, a warning, or an
implicit type conversion. - The pure PHP reader now rejects malformed metadata with
InvalidDatabaseExceptioninstead of aTypeError, a warning, or an
implicit type conversion. Missing optionallanguagesanddescription
fields default to empty arrays. - Missing gmp/bcmath support and offsets that exceed the platform limit now
throwMaxMind\Db\Reader\UnsupportedPlatformException. It extends
RuntimeException, so existing catches continue to work. - The pure PHP reader also throws
UnsupportedPlatformExceptionwhen the
metadata node count or the start of the data section exceeds the platform's
integer limit. These cases no longer produceInvalidDatabaseExceptionor
overflow into aTypeError. phpinfo()andphp --ri maxminddbnow show whether the extension was built
with the bundled libmaxminddb or links a system library. The
libmaxminddb library versionrow reads, for example,1.14.0 (bundled)or
1.9.1 (system). Pull request by Remi Collet. GitHub #289.- The PHPDoc of the pure PHP reader now lists the exceptions that its methods
can throw:- The
MaxMind\Db\Readerconstructor,get(), andgetWithPrefixLen()
declareUnsupportedPlatformException. The reader throws it when an
integer needs gmp or bcmath and neither is installed, or a data offset
exceeds the platform limit. - The constructor declares
UnexpectedValueException. close()declaresBadMethodCallExceptionin place ofException.
metadata()no longer declaresInvalidArgumentException, which it
cannot throw.MaxMind\Db\Reader\Decoder::decode()andMaxMind\Db\Reader\Util::read()
declare their exceptions.
- The
- The bundled libmaxminddb used by
--with-maxminddb-bundledbuilds of the
extension is now 1.14.1. This fixes a build failure with-Werroron
platforms wheressize_tis 32 bits, such as i686. - The classes in the pure PHP reader are now marked
@final. They will be
finalin the next major version. Static analyzers such as PHPStan report
a class that extends them. - On 64-bit Windows, the extension returned
uint32anduint64values
from 2^31 toPHP_INT_MAXas strings. It now returns them as integers.