To clarify -- these files in the error were NOT edited at the time of the error, I checked twice. And I checked again by doing a diff with a fresh WordPress install. I had to remove the broken line -- shown below -- because it crashes WordPress. This line does not crash all WordPress blogs, obviously, and I have another blog on the same LEMP stack without the fatal error. How is "kses" activated in this case? Is it the content of the blog? I don't know, but I don't see any plugin or theme in the stack trace.
Here's the error:
[error] FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /home/www-data/example.com/wp-includes/kses.php:1871 #0 /home/www-data/example.com/wp-includes/kses.php(1871): in_array() #1 [internal function]: wp_kses_named_entities() #2 /home/www-data/example.com/wp-includes/kses.php(1842): preg_replace_callback() #3 /home/www-data/example.com/wp-includes/formatting.php(981): wp_kses_normalize_entities()
This line does not work in PHP8:
return ( ! in_array( $i, $allowedentitynames, true ) ) ? "&$i;" : "&$i;";
There's no plugin or theme referring to "allowedentitynames" as per grep.