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
Hi,
Let me first say thank you for a such great software!!!
The problem which I have is related to passing PHP arrays, let's say [string=>string], into extension as a parameter and changing it inside some function. But when returning back to PHP the value is unchanged, no matter adding items to array or modifying existing ones. This issue does not happen with string or numeric variables. There is a workaround of returning an array from function (changing void to Php::Value) but then PHP code looks ugly, e.g.:
$x1=["temp"=>"change_me"];
$x1=someExtFunction($x1); // declaration in cpp: Php::Value someExtFunction(Php::Parameters& params){...}
The obvious usage seems to be like this:
$x1=["temp"=>"change_me"];
someExtFunction($x1); // declaration in cpp: void someExtFunction(Php::Parameters& params){...}
Is there a way to change Array variable passed ByRef?
Thanks & Regards,
Vadim.
The text was updated successfully, but these errors were encountered:
I'm having this same issue. Has anyone found a fix for this? I was trying to create a function similar to how preg_match works (http://php.net/manual/en/function.preg-match.php) by passing in the $matches array by reference, but any updates to the Array being made in the CPP file does not get returned to PHP.
It's not working for me either. I came back to this project after a couple of years, and now ByRef using an array does not work. This is with PHP-CPP 2.0.0.
Hi,
Let me first say thank you for a such great software!!!
The problem which I have is related to passing PHP arrays, let's say [string=>string], into extension as a parameter and changing it inside some function. But when returning back to PHP the value is unchanged, no matter adding items to array or modifying existing ones. This issue does not happen with string or numeric variables. There is a workaround of returning an array from function (changing void to Php::Value) but then PHP code looks ugly, e.g.:
$x1=["temp"=>"change_me"];
$x1=someExtFunction($x1); // declaration in cpp: Php::Value someExtFunction(Php::Parameters& params){...}
The obvious usage seems to be like this:
$x1=["temp"=>"change_me"];
someExtFunction($x1); // declaration in cpp: void someExtFunction(Php::Parameters& params){...}
Is there a way to change Array variable passed ByRef?
Thanks & Regards,
Vadim.
The text was updated successfully, but these errors were encountered: