You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware that using Php::ByRef in the method argument definition, values can be passed by reference and then cast to char * to avoid copying. Is it possible to achieve the same in the opposite direction: return a char * reference back to PHP?
One way I could see achieving this is passing another variable from PHP to use as the return value. Something like:
<?php$out = null;
method(in, &out);
voidmethod (Php::Parameters ¶ms)
{
constchar *input = params[0];
// Process it somehow to produce a new resultmemcpy(params[1].buffer(), new_value, new_value_size);
}
I am not certain if this would work, but a more PHP-friendly solution is still preferred.
The text was updated successfully, but these errors were encountered:
I am aware that using
Php::ByRef
in the method argument definition, values can be passed by reference and then cast tochar *
to avoid copying. Is it possible to achieve the same in the opposite direction: return achar *
reference back to PHP?One way I could see achieving this is passing another variable from PHP to use as the return value. Something like:
I am not certain if this would work, but a more PHP-friendly solution is still preferred.
The text was updated successfully, but these errors were encountered: