Welcome to LQ!
To reference the value of variables in bash, called variable expansion, you must precede the variable name with a $.
So to pass the values of X and Y in your php command you need to refer to them as $X and $Y. If the name would be ambiguous such as being surrounded by other characters then put the names inside curly braces, ${X} and ${Y}.
So you command might become (not tested in actual use, but you get the idea):
Code:
result=$(php -r "require 'testAddTwoNums-sol.php'; Calculator(${X},${Y},'+');")
Give that a try, and good luck!