I\'m setting up a system which will carry out various calculations on primitive data, and the provide an output based on the calculation.
My main question,
If I were you, I won't put calculation php in database. Why? Let say, you decided to write your system in another language, you will need to parse that php codes in db, and convert it to your new language specifics(This is worst scenario). If I were you, I will convert this to a service, and divide it into pieces. You can put each call in to job queue, after job completion, you can save results in db. You can use this service for several type of clients.
You can create functions for each calculations in order to change algorithm of calculations easily. Also, you can add new calculation as function.