I have a .net C# function that takes an double array as the first parameter and passes back another double precision array based on the first.
C# Code
public int testMath(double[] InputSet, double[] OutputSet)
{
// more complicated than what I am showing but
for (int i = 0; i < 3; i++)
{
OutputSet[i] = InputSet[i] * 2.0;
}
return 1; // Really something else
}
PHP
$mathTest = new DOTNET("MathTest,"
."Version=1.0.0.0,"
."Culture=neutral,"
."PublicKeyToken=213536b1e6bb8ea5"
, "MathTest.MathTest");
$inputValue = Array();
$outputValue = Array();
for ($i = 0; $i < 3; $i++){
$inputValue[$i] = $i * 3.0;
$outputValue[$i] = 0.0;
}
$status = $mathTest->testMath($inputValue, $outputValue);
When I try to run this I get an error that parameter 1 is a type mismatch.
I have other routines that take doubles as inputs and by ref outputs that work as I would expect. I can call this routine from other programming languages but I am stumped as to how to get it to work in PHP. I tried viewing the parameters using com_print_typeinfo and found that both arguments show up as VT_SAFEARRAY as IN. I did some testing to change argument 1 to be an OUT and it made it worse (won't run at all). Any suggestions would be greatly appreciated.