Historically, the driver does not throw when encountering a non-boolean value for a boolean option. Instead, the driver uses bson_iter_as_bool() to cast the value.
This is inconsistent with our handling of other options (including specific boolean options such as "journal"), which use BSON_ITER_HOLDS_TYPE() macros to guard processing. PHPC-887 introduces exceptions for unexpected types, but earlier versions of the driver silently ignore options with unexpected types.
Throwing exceptions for non-boolean types that are currently cast and applied would be a BC break, so this ticket has been triaged for the next major version.
- is related to
-
PHPC-887 Throw exceptions for unexpected types in URI options array
- Closed