Since WordPress 5.2 a fatal error gives you “There has been a critical error on this website” instead of the PHP message. Good for visitors, annoying when you write the code.
On a development site, put this in wp-config.php:
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
The first line turns off the fatal error handler, the part of WordPress that catches the error, shows the friendly page and emails a recovery mode link. The other two make PHP show errors in the page. Together you get the real message with the file and line number, which is what you want while breaking things on purpose.
The WordPress docs pair it with those debug lines for that reason. With the handler on, the error is caught before your display settings matter.
I’d never leave it like this on a live site. The handler is what gives you recovery mode: an admin can log in, see which plugin crashed and pause it. Without it, a broken plugin means a white or error page for everyone and no way in through the dashboard. And raw PHP errors show file paths to every visitor. On production, use WP_DEBUG_LOG and read the log file instead.
Further reading: wp-config: Disable the fatal error handler, wp_is_fatal_error_handler_enabled()