packagist brick/math 0.20.0

4 hours ago

💥 Breaking changes

  • Deprecated exception class UnsupportedPlatformException has been removed, catch PlatformException instead

The following breaking change only affects you if you specifically catch DivisionByZeroException around calls to of() or to any method accepting strings:

  • of() now throws NumberFormatException instead of DivisionByZeroException when the string is a fraction with a denominator of zero, such as '2/0'

New features

  • New methods: parse() and parseNullable() safely parse untrusted input, by restricting the allowed syntax and limiting the number of digits
  • New enum: NumberSyntax lists the syntax features that parse() can accept, with constants for the most common combinations

🐛 Bug fixes

  • of() no longer throws PlatformException on malformed input with many digits, crafted to trigger heavy backtracking in its parser; such input now throws NumberFormatException as documented

👌 Improvements

  • NumberFormatException messages now escape control and non-ASCII characters, and truncate values longer than 40 bytes, instead of copying the raw input into the message

Don't miss a new math release

NewReleases is sending notifications on new releases.