Description
When doing $obj + 123
, $obj
shouldn't be treated by PHP as a string when $obj
is a numeric representation.
Adding the magic casting method __toscalar
is handy for solving this.
Please release this patch.
See: https://wiki.php.net/rfc/object_cast_to_types