How does PHP handle floating point arithmetic and what potential issues can arise?

PHP uses floating-point numbers to handle decimal values in arithmetic operations. However, due to the way floating-point numbers are represented in binary, there can be precision errors when performing calculations. To mitigate this issue, it is recommended to use the `bcmath` extension in PHP, which provides arbitrary precision mathematics.

// Using the bcmath extension for precise floating-point arithmetic
$num1 = '0.1';
$num2 = '0.2';

$sum = bcadd($num1, $num2, 10); // 10 specifies the number of decimal places

echo $sum; // Outputs 0.3