-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Since most of the classes in the MongoDB namespace, we can start adding return type information to the zend_arginfo struct. This can be done by replacing ZEND_BEGIN_ARG_INFO with either ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO (PHP 7.4+) or ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO (PHP 7.0+) as appropriate.
On PHP 8 and later, we can also make use of union types. This should be done conditionally when compiling for PHP 8.