php cannot process
echo "Addition = " .$obj->get("num1") + $obj->get("num2");
as you expect. The following line will show the proper added result
echo "Addition = " . ( $obj->get("num1") + $obj->get("num2"));
You are not using proper html format, so, your new line will not work on html page
to avoid this, set your content type to plain text. Follow the example below:
header("Content-Type: text/plain");
Set the above line before you declare your class...