Java raises an error as well (operator + cannot be applied to boolean,boolean
), and so does Scheme.
It's also worth noting that PHP does have a real boolean type, it's just that when adding them, the variables automatically get cast to integers (with value 1) and added, and any non-zero integer (2 in this case) evaluates to true as well.
Casting the sum to a boolean and back will also give you 1, not 2.
PHP's type system is hilarious.