Actions
Bug #8836
closedCBLib Internal library issue: CBLib\Image\Color\stringToRGB() cache indexes not float
Description
Found during PHP 8.1 compatibilty tests and fixes, but as it's a bug, doing a separate tracker item and MR:
Array indices can only be text or int. Floats are casted to ints.
PHP 8.1 issues a nice deprecation warning for this:
Deprecated: Implicit conversion from float 127.5 to int loses precision in /home/beat/cb/git/cb/libraries/CBLib/CBLib/Image/Color.php on line 78 Deprecated: Implicit conversion from float 127.5 to int loses precision in /home/beat/cb/git/cb/libraries/CBLib/CBLib/Image/Color.php on line 84
PHP Manual reference:
https://www.php.net/manual/en/language.types.array.php
As both indices are between 0.0 and 1.0, any values in between are stored only as 0 or 1.
Actions