vanderlee / phpSyllable

PHP Syllable splitter/counter and Hyphenator for text and HTML. Multi-language, customisable, cached and fast!
http://vanderlee.github.io/phpSyllable/
117 stars 80 forks source link

Cache version in JSON cache file can be infinite decimal #65

Closed alexander-nitsche closed 1 year ago

alexander-nitsche commented 1 year ago

Depending on the PHP version used, the cache version encoding in a JSON cache file may result in 1.399999999999 instead of 1.4. This is due to the internal handling of floating point numbers. It might be best to add the cache version as a string, as this is safe with JSON encoding.

I have observed the wrong behavior in Debian 11, PHP 7.4.33 (cli) (built: Feb 14 2023 18:01:29) ( NTS ).

vanderlee commented 1 year ago

That's probably best. Would also stop limiting it to two digit version so we can use SemVer.