Closed morpheouss closed 6 years ago
Either create a super global variable and register it via ph7_vm_config() using the PH7_VM_CONFIG_CREATE_SUPER verb or register a foreign function and call it the last one before you die. On the foreign function body (i.e. your C code) you can extract the variable content passed to you as an argument.
Thats not a solution for me. I need to take the value returned by specified function and/or whole script. If script uses exit I can catch it via ph7_vm_exec. But returned value is not catched like that. How can I take the value returned by script?
That's the only way to deal with variables shared between C and PHP. Jx9 introduces the jx9_vm_extract_variable() interface that let you do this specifically which is unfortunately not implemented in PH7.
I am writing a program that embeds ph7. It executes script and calls a function. This functions returns some value. How can I get this value outside script?