Closed genericmilk closed 3 years ago
Hi folkes,
Came across an exception using PHP 8.0.3 and Laravel 8.36.0.
When converting an (int) to a Hashid using Hashids::encode($l->id); (Where $l->id is a number eg. 12345) an exception is reliably thrown:
Hashids::encode($l->id);
$l->id
Unsupported operand types: int - string
This occurs at: vendor/hashids/hashids/src/Hashids.php:203
$excess = \mb_strlen($ret) - $this->minHashLength;
This does not occur on previous versions of PHP 7.4 etc. Tested using dev-master to ensure most up-to-date changes to the codebase are loaded
Silly me, just realised this is the wrong package and the file in question pertains to vinkla/hashids 😵 My apologies!
Hi folkes,
Came across an exception using PHP 8.0.3 and Laravel 8.36.0.
When converting an (int) to a Hashid using
Hashids::encode($l->id);
(Where$l->id
is a number eg. 12345) an exception is reliably thrown:Unsupported operand types: int - string
This occurs at: vendor/hashids/hashids/src/Hashids.php:203
$excess = \mb_strlen($ret) - $this->minHashLength;
This does not occur on previous versions of PHP 7.4 etc. Tested using dev-master to ensure most up-to-date changes to the codebase are loaded