What are the potential pitfalls of using floating-point arithmetic in PHP when dealing with currency calculations?

When dealing with currency calculations in PHP, using floating-point arithmetic can lead to rounding errors due to the way floating-point numbers are stored and processed. To avoid these pitfalls, it is recommended to use the `BCMath` extension in PHP, which provides arbitrary precision arithmetic for working with numbers.

// Using BCMath extension for precise currency calculations
$price1 = '10.25';
$price2 = '20.50';

// Adding two prices
$total = bcadd($price1, $price2, 2);

echo $total; // Output: 30.75