doctrine / doctrine-laminas-hydrator

Doctrine hydrators for Laminas applications
https://www.doctrine-project.org/projects/doctrine-laminas-hydrator.html
MIT License
33 stars 19 forks source link

Wrong case of decimal and bigint #26

Closed lampi87 closed 2 years ago

lampi87 commented 3 years ago

Hi everyone,

I've already create a PR for this issue but it wasn't merged or commented. At the moment, decimal are casted as "string" this lead to errors when using strict types in php7.4

Best regards, Alexander

driehle commented 2 years ago

Relates to #24

driehle commented 2 years ago

As pointed out in #24, the current behaviour is correct. A bigint must be casted to string, as bigint exceed PHP's int range. A decimal must be casted to string as well, as floats loose precision, while decimals don't.