Applied #16 and this helped me greatly. Recently upgraded to PHP 8.2 and was getting 500 errors.
Specifically, I was having issues due to the fact that the core Drupal 7 system module's system_entity_info function was being called and this helps skip past that.