I have a lot of mathematical calculations in my PHP script, which can be quite slow at times. I\'m wondering if it\'s possible to pass data from PHP to C++, do the calculati
From what i know the best solution would be writing PHP extension in C++.
This gives you possibility to create your own 'native' PHP function which you will name my_func(). And it will do all calculations you need with speed of C++ application and return you result as output from my_func().
You may want to look at this question: How to start writing a PHP5 extension in C++