Troubleshooting a TypeError in License.php

Symptom

After applying the 8.2.0 update, you may occasionally observe a TypeError error message in certain environments:

ERROR: TypeError: random_int() expects parameter 2 to be int, float given in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/License.php

Solution

Please apply the 8.2.1 Maintenance Release via the Utilities > Update WHMCS page.

Workaround

Switch to a 64-bit PHP environment.

Hotfix

A hotfix has been created for 8.2.0 only to correct this behaviour:

https://whmcs.community/files/file/166-core-16846-correct-typeerror-in-licensephp/