zend_call_method_with_N_params
PHP扩展开发中有zend_call_method_with_0_params
、zend_call_method_with_1_params
和zend_call_method_with_2_params
。
但是如何调用超过2个参数的方法呢?
There are zend_call_method_with_0_params
, zend_call_method_with_1_params
and zend_call_method_with_2_params
in PHP extension development.
But how to call method with more than 2 params?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前的回答是错误的。您必须直接使用
zend_call_function
。请参阅zend_call_method
的正文。基本上,您必须首先准备一个zend_fcall_info
对象。参数数量应存储在fci.param_count
字段中,并且fci.params
应具有一个包含fci.param_count
元素的数组。My previous answer was wrong. You have to use
zend_call_function directly
. See the body ofzend_call_method
. Basically you have to prepare azend_fcall_info
object first. The number of arguments should be stored in thefci.param_count
field andfci.params
should have an array withfci.param_count
elements.