php - 如何在我自己的扩展中将 file_handle 参数添加到 php 中的 call_user_func_ex?
问题描述
我想在zendaccelerator.c 中使用我自己的函数,但我无法将file_handler 参数传递给call_user_func_ex。请检查我的样品并给我一些建议...
zend_op_array *own_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) {
zval *function_name;
zend_op_array *opcode_array;
zval *params = { file_handle, TSRMLS_DC };
TSRMLS_FETCH();
MAKE_STD_ZVAL(function_name);
ZVAL_STRINGL(function_name, FUNC_NAME, strlen(FUNC_NAME));
if (call_user_function_ex(CG(function_table), NULL, function_name, &opcode_array, 2, params, 0, NULL TSRMLS_CC) != SUCCESS) {
zend_error(E_ERROR, "Function name compile failed");
return NULL;
}
FREE_ZVAL(function_name);
return opcode_array;
}
当我在 Centos7 上进行制作时,我收到以下错误消息:警告:从不兼容的指针类型初始化 (zval *params...)
解决方案
推荐阅读
- android - 如何使用 android 中的 kotlin 合成从包含的布局中访问视图
- video - RTSP 公告将有什么序列号?
- javascript - 如何防止我的获取请求出现 CORS 和混合内容错误
- html - HTML 5 验证服务
- node.js - 使用 Puppeteer 捕获原始请求
- python-3.x - tornado 同时处理多个请求
- kotlin - kotlin 中 Int.toString() 的时间复杂度
- android - 无法通过 Intent 在活动之间传递数据
- ontology - 尝试在大型本体中执行 SQWRL 查询的问题
- momentjs - moment.tz 使用 UTC