Mage_Catalog_Block_Product::getPriceHtml causes errors with PHP 7 (Magento 1)

The following Magento 1 code no longer works with PHP 7 or later:

With PHP 7, you need to create an instance of Mage_Catalog_Block_Product and call getPriceHtml on that instance.