What are the best practices for error reporting in PHP to ensure warnings are displayed for uninitialized variables?

To ensure warnings are displayed for uninitialized variables in PHP, it is best practice to set error_reporting to E_ALL in your PHP configuration or at the beginning of your script. This will enable all error reporting, including warnings for uninitialized variables.

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

// Your PHP code here
?>