> Throwing an exception would be rather uncommon for functions, and would
> definitely have to wait for PHP 8 for BC reasons.

Sure. This is actually a discussion I'd like to start for all PHP functions
in PHP 8.

>Another option might
> be to introduce an object-oriented layer on top of libbcmath.

That would be nice, but I the meantime though (PHP 7.4?) we could just add
a warning when the number is malformed and zero is returned for this reason.
At least this warning can be logged, or caught by an error handler to
convert it to an exception in userland.

- Ben

Reply via email to