What are common pitfalls when using ini_set() function for error display in PHP?

Common pitfalls when using ini_set() function for error display in PHP include setting the error_reporting level too high, which can result in displaying sensitive information to users, or setting it too low, which can hide important error messages. To avoid these pitfalls, it is recommended to set error_reporting to E_ALL for development environments and E_ERROR | E_WARNING | E_PARSE for production environments.

// Set error reporting level to E_ALL for development
ini_set('error_reporting', E_ALL);

// Set error reporting level to E_ERROR | E_WARNING | E_PARSE for production
ini_set('error_reporting', E_ERROR | E_WARNING | E_PARSE);