Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented breaking change due to type hints #81

Open
garygreen opened this issue Aug 19, 2022 · 1 comment
Open

Undocumented breaking change due to type hints #81

garygreen opened this issue Aug 19, 2022 · 1 comment

Comments

@garygreen
Copy link

garygreen commented Aug 19, 2022

We're updating to latest version and have noticed a breaking change when using:

Hash::fromInt($num);

This use to allow strings, nulls and even super large integers - but now it seems restricted to int type due to this commit:

v0.6.0...v0.7.0

PHP int value is limited in size, so when we try to use it from values using BIGINT from mysql it no longer works - mysql will return BIGINT values as strings in PHP because they cannot be used as native ints. That's the whole purpose of the BIGINT library, right?

E.g. this is a BIGINT of a difference hash for one of our pictures in our database and it doesn't fit as an int.

echo (int)'10957988095268482955'

fromInt shouldn't typehint int because it's whole purpose is to support big ints.

@garygreen
Copy link
Author

garygreen commented Mar 7, 2023

@jenssegers Any news on this breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant