Impossible to do it
When performing this integration, you can solve several problems:
As in the PHP manual, the returned object is an overloaded object that causes PHP to not know about the public methods that the object may contain. So, if you are var_dump, you will only see an empty array. This is why the internal structure of a DLL class must be known before it is called.
Fortunately for us, there is another tool specialized for this work that comes with the .NET platform called ildasm.exe. It is located next to gacutil.exe under c: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Bin \ or c: \ Program Files (x86) \ Microsoft SDK \ Windows \ v6.0A \ bin. To load and display the DLL structure, simply call "ildasm.exe \ path \ to \ your.dll".
2. parameters Another problem is that you cannot pass parameters to the class constructor in the DLL.
- Data types
Being two different programming languages, we have different data types. In doing so, you will need to make sure that the methods of the DLL class return data types that PHP understands (mainly strings, ints, booleans, etc.). If your methods should return a list of arrays or a more complex structure, you can consider JSON for encoding.
More in
http://blog.zitec.com/2012/handling-net-assemblies-in-php/
source share