arginfo structs are initialised with ZEND_BEGIN_ARG_INFO, or ZEND_BEGIN_ARG_INFO_EX.

This pull request (https://github.com/mgdm/Mosquitto-PHP/pull/3/files [^]) adds for example ZEND_BEGIN_ARG_INFO structs to Mosquito. But it doesn't take into account the number of optional arguments. For that, you need the more complicated ZEND_BEGIN_ARG_INFO_EX.

The different items for each argument are defined at http://lxr.php.net/xref/PHP-7.1/Zend/zend_API.h#100 [^] (ZEND_ARG_INFO etc.) With the pass_by_ref argument to this macro being either 0 or 1. (Always 0 in Xebug I think, as there is no pass_by_ref arguments).