When testing PHP scripts, what are some common pitfalls to watch out for to prevent displaying a white page?

One common pitfall when testing PHP scripts is encountering syntax errors or fatal errors that result in a white page being displayed. To prevent this, always ensure that your PHP error reporting is enabled and set to display errors on the screen. This will help identify any issues in your code that may be causing the white page.

// Enable error reporting to display errors on the screen
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);