What are the advantages and disadvantages of using BOM in UTF-8 encoding for PHP scripts?

When using UTF-8 encoding for PHP scripts, including a Byte Order Mark (BOM) can cause issues such as unexpected output or errors. It is recommended to avoid using BOM in UTF-8 encoded PHP files to prevent these problems.

<?php
// PHP script without BOM in UTF-8 encoding
echo "Hello, World!";
?>