We did a host migration from php 7.4 to 8.2 and noticed some of our old scripts did not work throwing these errors

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: array *int

After investigating the issue, we found the error was with type casting, which php versions above 8 are strict.

This error occurs when you do math operations with string and int. An easy way to fix the issue is with type casting. See the example below.

$total = (int) $number + (int) $weight;

If you pass variables in function, do this way

function example ( (int)$total, (int)$height, (array)$age) );

Hope this helps.