What are the potential pitfalls of using PHP for calculations involving decimal points?

When performing calculations involving decimal points in PHP, the language's floating-point arithmetic can sometimes lead to inaccuracies due to the way computers represent real numbers. To avoid these pitfalls, it is recommended to use the BCMath extension in PHP, which provides arbitrary precision mathematics for working with decimal numbers.

$number1 = '0.1';
$number2 = '0.2';

$sum = bcadd($number1, $number2, 2);

echo $sum;