Diego Medeiros - 2014-05-22 16:24:08
Thanks for this class! Great work! :D
The class work fine to:
$math->evaluate("xx = 2");
$math->evaluate("yy = 2");
$math->evaluate("zz = xx + yy");
echo $math->evaluate("zz"); //print 4
But I need this:
$math->evaluate("xx = 2");
$math->evaluate("zz = xx + yy"); //yy is undefined
$math->evaluate("yy = 2");
echo $math->evaluate("zz"); //empty
My vars and functions are in a database, are hundreds, so i can't specify the functions order. So, i need accumulate the variables values to calculate only at a specific time (in the end).
I think the answer must lie in the use of the '$this->v[]' variable in class, but I do not have sufficient knowledge to fix it.
How could I do this?? Thanks in advance.
ps: Sorry my bad english.