1

In my PHP extension, how can I create an op_array with no opcodes in it?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.