Open srakl opened 2 years ago
i narrowed down the problem to hashids.php
line 241.
$ret = substr($ret, $excess / 2, $this->_min_hash_length);
where
$ret = mz1xVX2WLMBPO4Gw7N5QDybzz2b9J6ZdpERa8Kegjl3Yo0vAr
$excess = 41
$this->_min_hash_length = 8
Thanks your report, I will handle it later.
https://github.com/vinkla/hashids/issues/179
I find same issues from vinkla/hashids
In fact, I dont know php8 or higher, but I find the signature of substr
from https://www.php.net/manual/en/function.substr.php
substr(string $string, int $offset, ?int $length = null): string
the second parameter is marked as the type of int
, so it's not Compatible with php8.0
Maybe I should upgrade the library to fix this
Maybe you should know only hashids/hashids:4.1.0 support php8 or higher now.
I'm getting this error on php version 8.1.1
Implicit conversion from float 20.5 to int loses precision
it works fine on php 8.0.8
error is on this code
Where
$model->id
is the row id the in a table and is an int. So far im getting the error forid
766