An example of PHP's automatic type conversion is the addition operator '+'. If either operand is a float, then both operands are evaluated as floats, and the result will be a float. Otherwise, the operands will be interpreted as integers, and the result will also be an integer.
What you need to be doing instead is adding some math methods to you objects, or referencing the values directly:
$sum = $byte->theValue() + $double->theValue(); // etc.
I do have a Math class with a group of static methods to do these, but I was wondering if there were easier ways. Anyway nvm, it is just an experience I am conducting, PHP clearly aint like ruby in which everything is an object so some techniques do not work.
I suppose that if you had the __toString() method return a numeric string, you could do something (kind of ugly) like:
$total = $someNumber + (string)$someObject;
But that seems a rather obfuscating thing to do -- not something I'd care to run into when maintaining that code a year later, even if I didn't have to prepend the (string) part. Much easier to read would be: