3

I'm trying to write an extension for PHP and i need to execute some PHP code.

After searching i figured out that i could use "zend_eval_string" in my c extension. my problem is that i need the return value from the code that executed by this function.

for example the code is : "return array(...);" I need to execute the code and get the returned array.

I already tried this but it wont help

zval retval;
zend_eval_string(code, &retval, "" TSRMLS_CC);
2
  • 1
    stackoverflow.com/questions/17383672/… Commented Apr 13, 2014 at 10:05
  • 2
    i saw this before but the return value in this example is int and specify that the code execution was successful or not. i need the return value of evaluated script. Commented Apr 13, 2014 at 10:08

0

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.