What are some common pitfalls when working with floating-point numbers in PHP?

One common pitfall when working with floating-point numbers in PHP is the issue of precision loss due to the way floating-point numbers are stored in memory. To solve this problem, it is recommended to use the `round()` function with a specified precision when performing arithmetic operations on floating-point numbers.

$number1 = 0.1;
$number2 = 0.2;

$sum = round($number1 + $number2, 2);

echo $sum; // Output: 0.3