I lost some time trying to know how to find the returned type.
It's not that obvious it is stored in the _argument_ information array.
For the sake of Internet, here is the full code checking that a function _has_ a returned type:
```c
zend_function *function = /* e.g. fci_cache->function_handler */;
if (!(function->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
php_printf("no return type\n");
} else {
php_printf("has a return type\n");
php_printf("return type = %s\n", zend_get_type_by_const(ZEND_TYPE_CODE(function->common.arg_info[-1].type)));
}
```
zend_function *prototype;
uint32_t num_args;
uint32_t required_num_args;
- zend_arg_info *arg_info;
+ zend_arg_info *arg_info; /* index -1 represents the return value info, if any */
} common;
zend_op_array op_array;