What changes in PHP 7.2 affect how numbers are stored in a database as floats?

In PHP 7.2, the serialize_precision ini directive was introduced, which affects how floating-point numbers are stored in a serialized format. This can lead to unexpected changes in the way numbers are stored in a database as floats. To solve this issue, you can set the serialize_precision directive to -1 in your PHP configuration file to ensure that floating-point numbers are serialized with full precision.

// Set serialize_precision to -1 in your PHP configuration file
ini_set('serialize_precision', -1);