In my PHP extension, how can I create an op_array with no opcodes in it?
Asked
Active
Viewed 272 times
1 Answers
1
You can use init_op_array(), declared in from zend_compile.h:
zend_op_array * op_array = emalloc(sizeof(zend_op_array));
init_op_array(op_array, type, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
type can be ZEND_EVAL_CODE or ZEND_USER_FUNCTION.

Arnaud Le Blanc
- 98,321
- 23
- 206
- 194